drupal-civicrm/sites/all/modules/civicrm/bower_components/phantomjs-polyfill/bind-polyfill.js

19 lines
610 B
JavaScript
Raw Permalink Normal View History

2018-01-14 15:10:16 +02:00
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;
};
}