author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 06 Jul 2010 14:03:49 +0300 | |
changeset 6 | 1c3b8676e58c |
parent 5 | 0f2326c2a325 |
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; }