function-uncurry-this.js 379 B

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