ginebra2/chrome/js/Bind.js
author William Roberts <williamr@symbian.org>
Thu, 22 Jul 2010 16:30:16 +0100
branchGCC_SURGE
changeset 8 2e16851ffecd
parent 5 0f2326c2a325
permissions -rw-r--r--
Catchup to latest Symbian^4


// 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;
}