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.

15 lines
511 B

1 month ago
  1. 'use strict';
  2. var bind = require('function-bind');
  3. var $TypeError = require('es-errors/type');
  4. var $call = require('./functionCall');
  5. var $actualApply = require('./actualApply');
  6. /** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
  7. module.exports = function callBindBasic(args) {
  8. if (args.length < 1 || typeof args[0] !== 'function') {
  9. throw new $TypeError('a function is required');
  10. }
  11. return $actualApply(bind, $call, args);
  12. };