BlobCallback.js 828 B

123456789101112131415161718192021222324252627282930
  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(blob) {
  9. const thisArg = utils.tryWrapperForImpl(this);
  10. let callResult;
  11. blob = utils.tryWrapperForImpl(blob);
  12. callResult = Reflect.apply(value, thisArg, [blob]);
  13. }
  14. invokeTheCallbackFunction.construct = blob => {
  15. blob = utils.tryWrapperForImpl(blob);
  16. let callResult = Reflect.construct(value, [blob]);
  17. };
  18. invokeTheCallbackFunction[utils.wrapperSymbol] = value;
  19. invokeTheCallbackFunction.objectReference = value;
  20. return invokeTheCallbackFunction;
  21. };