UNPKG

775 BJavaScriptView Raw
1'use strict';
2var $ = require('../internals/export');
3var functionApply = require('../internals/function-apply');
4var aCallable = require('../internals/a-callable');
5var anObject = require('../internals/an-object');
6var fails = require('../internals/fails');
7
8// MS Edge argumentsList argument is optional
9var OPTIONAL_ARGUMENTS_LIST = !fails(function () {
10 // eslint-disable-next-line es/no-reflect -- required for testing
11 Reflect.apply(function () { /* empty */ });
12});
13
14// `Reflect.apply` method
15// https://tc39.es/ecma262/#sec-reflect.apply
16$({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, {
17 apply: function apply(target, thisArgument, argumentsList) {
18 return functionApply(aCallable(target), thisArgument, anObject(argumentsList));
19 }
20});