Older versions of Safari do not support bind
. If you try this ( http://jsfiddle.net/ambiguous/dKbFh/ ):
console.log(typeof Function.prototype.bind == 'function');
you will get false
in earlier versions of Safari, but true
in recent versions of Firefox and Chrome. I'm not sure about Opera or IE, but there is a compatibility list (which may or may not be accurate):
http://kangax.github.com/es5-compat-table/
You can try to fix your own version with something like this :
Function.prototype.bind = function (bind) { var self = this; return function () { var args = Array.prototype.slice.call(arguments); return self.apply(bind || null, args); }; };
but check if Function.prototype.bind
exists.
source share