13 lines
325 B
JavaScript
Executable file
13 lines
325 B
JavaScript
Executable file
var FunctionPrototype = Function.prototype;
|
|
var bind = FunctionPrototype.bind;
|
|
var call = FunctionPrototype.call;
|
|
var callBind = bind && bind.bind(call);
|
|
|
|
module.exports = bind ? function (fn) {
|
|
return fn && callBind(call, fn);
|
|
} : function (fn) {
|
|
return fn && function () {
|
|
return call.apply(fn, arguments);
|
|
};
|
|
};
|