Function.prototype.bind emulation; enable compatibility.js for multi_page_viewer

This commit is contained in:
notmasteryet 2011-07-05 21:32:15 -05:00
parent 2179cd0943
commit e5762f3ec8
2 changed files with 14 additions and 0 deletions

View file

@ -137,4 +137,17 @@
};
})();
// Function.prototype.bind ?
(function() {
if (typeof Function.prototype.bind !== "undefined")
return;
Function.prototype.bind = function(obj) {
var fn = this, headArgs = Array.prototype.slice.call(arguments, 1);
var binded = function(tailArgs) {
var args = headArgs.concat(tailArgs);
return fn.apply(obj, args);
};
return binded;
};
})();