mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
13 lines
386 B
JavaScript
13 lines
386 B
JavaScript
|
|
var uncurryThis = require('../internals/function-uncurry-this');
|
||
|
|
var aCallable = require('../internals/a-callable');
|
||
|
|
|
||
|
|
var bind = uncurryThis(uncurryThis.bind);
|
||
|
|
|
||
|
|
// optional / simple context binding
|
||
|
|
module.exports = function (fn, that) {
|
||
|
|
aCallable(fn);
|
||
|
|
return that === undefined ? fn : bind ? bind(fn, that) : function (/* ...args */) {
|
||
|
|
return fn.apply(that, arguments);
|
||
|
|
};
|
||
|
|
};
|