This commit is contained in:
Eric Rowell
2013-04-08 00:43:10 -07:00
parent 0e60ccc27e
commit 2f6e93dab6

View File

@@ -135,6 +135,22 @@ var Kinetic = {};
}
}
};
// bind() shim for older browsers
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () {},
fBound = function () {
return fToBind.apply(this instanceof fNOP && oThis ? this : oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
return fBound;
};
}
})();
// Uses Node, AMD or browser globals to create a module.