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
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var GetIntrinsic = require('get-intrinsic');
|
---|
| 4 | var callBound = require('call-bind/callBound');
|
---|
| 5 |
|
---|
| 6 | var $TypeError = require('es-errors/type');
|
---|
| 7 |
|
---|
| 8 | var IsArray = require('./IsArray');
|
---|
| 9 |
|
---|
| 10 | var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');
|
---|
| 11 |
|
---|
| 12 | // https://262.ecma-international.org/6.0/#sec-call
|
---|
| 13 |
|
---|
| 14 | module.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.