source: imaps-frontend/node_modules/es-abstract/2024/Call.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 614 bytes
RevLine 
[d565449]1'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4var callBound = require('call-bind/callBound');
5
6var $TypeError = require('es-errors/type');
7
8var IsArray = require('./IsArray');
9
10var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');
11
12// https://262.ecma-international.org/6.0/#sec-call
13
14module.exports = function Call(F, V) {
15 var argumentsList = arguments.length > 2 ? arguments[2] : [];
16 if (!IsArray(argumentsList)) {
17 throw new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');
18 }
19 return $apply(F, V, argumentsList);
20};
Note: See TracBrowser for help on using the repository browser.