author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 00:04:54 +0300 | |
changeset 15 | 73c48011b8c7 |
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; }