You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
445 B

3 months ago
  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. };