SyncWasmModule.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. */
  4. "use strict";
  5. const NormalModule = require("../NormalModule");
  6. const makeSerializable = require("../util/makeSerializable");
  7. /** @import { BuildMeta } from "../Module" */
  8. /** @import { NormalModuleCreateData } from "../NormalModule" */
  9. /**
  10. * Defines the build meta properties specific to sync wasm modules.
  11. * @typedef {object} KnownSyncWasmModuleBuildMeta
  12. * @property {Record<string, string>=} jsIncompatibleExports
  13. */
  14. /** @typedef {BuildMeta & KnownSyncWasmModuleBuildMeta} SyncWasmModuleBuildMeta */
  15. /**
  16. * Module class for `webassembly/sync` modules. Wasm-specific properties should live here instead of `NormalModule`.
  17. */
  18. class SyncWasmModule extends NormalModule {
  19. /**
  20. * @param {NormalModuleCreateData} options options object
  21. */
  22. constructor(options) {
  23. super(options);
  24. // Redeclared with the sync wasm specific shape
  25. /** @type {SyncWasmModuleBuildMeta | undefined} */
  26. this.buildMeta = undefined;
  27. }
  28. }
  29. makeSerializable(SyncWasmModule, "webpack/lib/wasm-sync/SyncWasmModule");
  30. module.exports = SyncWasmModule;