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.

Call.js 464B

12345678910111213141516171819
  1. 'use strict';
  2. var GetIntrinsic = require('../GetIntrinsic');
  3. var $TypeError = GetIntrinsic('%TypeError%');
  4. var inspect = require('object-inspect');
  5. var IsCallable = require('./IsCallable');
  6. // https://www.ecma-international.org/ecma-262/6.0/#sec-call
  7. module.exports = function Call(F, V) {
  8. var args = arguments.length > 2 ? arguments[2] : [];
  9. if (!IsCallable(F)) {
  10. throw new $TypeError(inspect(F) + ' is not a function');
  11. }
  12. return F.apply(V, args);
  13. };