Files
weave-scope/client/test/polyfill.js
2015-09-02 16:00:28 +02:00

22 lines
574 B
JavaScript

/**
* Function.prototype.bind polyfill used by PhantomJS
*/
if (typeof Function.prototype.bind != 'function') {
Function.prototype.bind = function bind(obj) {
var args = Array.prototype.slice.call(arguments, 1),
self = this,
nop = function() {
},
bound = function() {
return self.apply(
this instanceof nop ? this : (obj || {}), args.concat(
Array.prototype.slice.call(arguments)
)
);
};
nop.prototype = this.prototype || {};
bound.prototype = new nop();
return bound;
};
}