web 3d图形渲染器
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.

24 lines
715 B

  1. 'use strict';
  2. var GetIntrinsic = require('get-intrinsic');
  3. var $TypeError = GetIntrinsic('%TypeError%');
  4. var Call = require('./Call');
  5. var IsArray = require('./IsArray');
  6. var GetV = require('./GetV');
  7. var IsPropertyKey = require('./IsPropertyKey');
  8. // https://ecma-international.org/ecma-262/6.0/#sec-invoke
  9. module.exports = function Invoke(O, P) {
  10. if (!IsPropertyKey(P)) {
  11. throw new $TypeError('Assertion failed: P must be a Property Key');
  12. }
  13. var argumentsList = arguments.length > 2 ? arguments[2] : [];
  14. if (!IsArray(argumentsList)) {
  15. throw new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');
  16. }
  17. var func = GetV(O, P);
  18. return Call(func, O, argumentsList);
  19. };