function-uncurry-this.js 445 B

12345678910111213
  1. 'use strict';
  2. var NATIVE_BIND = require('../internals/function-bind-native');
  3. var FunctionPrototype = Function.prototype;
  4. var call = FunctionPrototype.call;
  5. // eslint-disable-next-line es/no-function-prototype-bind -- safe
  6. var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
  7. module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
  8. return function () {
  9. return call.apply(fn, arguments);
  10. };
  11. };