sproutcore/sproutcore — Issue #627: Nice to have SC support Function#bind()
Author: rajeshsegu
Created: 2011-11-11 19:12:31+00:00
State: open

Right now we have it as par to of our application code, but I wish this was inside SC1.7

Function.prototype.bind = Function.prototype.bind || function(thisObj) {
var that = this,
args;
if (arguments.length > 1) {
args = Array.prototype.slice.call(arguments, 1);
}

return function() {
var args2 = Array.prototype.slice.call(arguments || []);
return that.apply(thisObj, args.concat(args2));
};
};

Fallback on older browsers is very important.