1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-09-20 14:01:55 +00:00
musix-oss/node_modules/es-abstract/2016/Call.js

20 lines
464 B
JavaScript
Raw Normal View History

2020-03-03 20:30:50 +00:00
'use strict';
var GetIntrinsic = require('../GetIntrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var inspect = require('object-inspect');
var IsCallable = require('./IsCallable');
// https://www.ecma-international.org/ecma-262/6.0/#sec-call
module.exports = function Call(F, V) {
var args = arguments.length > 2 ? arguments[2] : [];
if (!IsCallable(F)) {
throw new $TypeError(inspect(F) + ' is not a function');
}
return F.apply(V, args);
};