WXL
4 天以前 2cc85c64f1c64a2dbaeae276a3e2ca8420de76b7
node_modules/webpack/lib/wasm-sync/WebAssemblyParser.js
@@ -22,6 +22,7 @@
const JS_COMPAT_TYPES = new Set(["i32", "i64", "f32", "f64", "externref"]);
/**
 * Gets js incompatible type.
 * @param {t.Signature} signature the func signature
 * @returns {null | string} the type incompatible with js types
 */
@@ -64,6 +65,7 @@
class WebAssemblyParser extends Parser {
   /**
    * Parses the provided source and updates the parser state.
    * @param {string | Buffer | PreparsedAst} source the source to parse
    * @param {ParserState} state the parser state
    * @returns {ParserState} the parser state
@@ -92,7 +94,8 @@
      /** @type {Record<string, string> | undefined} */
      let jsIncompatibleExports = (buildMeta.jsIncompatibleExports = undefined);
      /** @type {(ModuleImport | null)[]} */
      /** @typedef {ModuleImport | null} ImportNode */
      /** @type {ImportNode[]} */
      const importedGlobals = [];
      t.traverse(module, {
@@ -139,6 +142,7 @@
         Global({ node }) {
            const init = node.init[0];
            /** @type {ImportNode} */
            let importNode = null;
            if (init.id === "get_global") {