| author | hgs |
| Mon, 12 Jul 2010 15:46:53 -0400 | |
| changeset 7 | a1f515018ac1 |
| parent 3 | 0954f5dd2cd0 |
| permissions | -rw-r--r-- |
// Bind a function’s scope at definition instead of execution. Useful // for controlling the 'this' pointer in callbacks. Function.prototype.bind = function(obj) { var method = this, temp = function() { return method.apply(obj, arguments); }; return temp; } function createDelegate(object, method) { var shim = function() { method.apply(object, arguments); } return shim; }