| | |
| | | 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 |
| | | */ |
| | |
| | | |
| | | 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 |
| | |
| | | /** @type {Record<string, string> | undefined} */ |
| | | let jsIncompatibleExports = (buildMeta.jsIncompatibleExports = undefined); |
| | | |
| | | /** @type {(ModuleImport | null)[]} */ |
| | | /** @typedef {ModuleImport | null} ImportNode */ |
| | | /** @type {ImportNode[]} */ |
| | | const importedGlobals = []; |
| | | |
| | | t.traverse(module, { |
| | |
| | | Global({ node }) { |
| | | const init = node.init[0]; |
| | | |
| | | /** @type {ImportNode} */ |
| | | let importNode = null; |
| | | |
| | | if (init.id === "get_global") { |