VoidFunction.js 728 B

1234567891011121314151617181920212223242526
  1. "use strict";
  2. const conversions = require("webidl-conversions");
  3. const utils = require("./utils.js");
  4. exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
  5. if (typeof value !== "function") {
  6. throw new globalObject.TypeError(context + " is not a function");
  7. }
  8. function invokeTheCallbackFunction() {
  9. const thisArg = utils.tryWrapperForImpl(this);
  10. let callResult;
  11. callResult = Reflect.apply(value, thisArg, []);
  12. }
  13. invokeTheCallbackFunction.construct = () => {
  14. let callResult = Reflect.construct(value, []);
  15. };
  16. invokeTheCallbackFunction[utils.wrapperSymbol] = value;
  17. invokeTheCallbackFunction.objectReference = value;
  18. return invokeTheCallbackFunction;
  19. };