summaryrefslogtreecommitdiffstats
path: root/node_modules/@webassemblyjs/ast
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
commite06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (patch)
tree55713f725f77b44ebfec86e4eec3ce33e71458ca /node_modules/@webassemblyjs/ast
downloadwebsite_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.gz
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.bz2
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.zip
api, login, auth
Diffstat (limited to 'node_modules/@webassemblyjs/ast')
-rw-r--r--node_modules/@webassemblyjs/ast/LICENSE21
-rw-r--r--node_modules/@webassemblyjs/ast/README.md167
-rw-r--r--node_modules/@webassemblyjs/ast/esm/clone.js10
-rw-r--r--node_modules/@webassemblyjs/ast/esm/definitions.js663
-rw-r--r--node_modules/@webassemblyjs/ast/esm/index.js6
-rw-r--r--node_modules/@webassemblyjs/ast/esm/node-helpers.js84
-rw-r--r--node_modules/@webassemblyjs/ast/esm/node-path.js137
-rw-r--r--node_modules/@webassemblyjs/ast/esm/nodes.js915
-rw-r--r--node_modules/@webassemblyjs/ast/esm/signatures.js199
-rw-r--r--node_modules/@webassemblyjs/ast/esm/transform/denormalize-type-references/index.js76
-rw-r--r--node_modules/@webassemblyjs/ast/esm/transform/wast-identifier-to-index/index.js216
-rw-r--r--node_modules/@webassemblyjs/ast/esm/traverse.js96
-rw-r--r--node_modules/@webassemblyjs/ast/esm/types/basic.js0
-rw-r--r--node_modules/@webassemblyjs/ast/esm/types/nodes.js0
-rw-r--r--node_modules/@webassemblyjs/ast/esm/types/traverse.js0
-rw-r--r--node_modules/@webassemblyjs/ast/esm/utils.js265
-rw-r--r--node_modules/@webassemblyjs/ast/lib/clone.js17
-rw-r--r--node_modules/@webassemblyjs/ast/lib/definitions.js663
-rw-r--r--node_modules/@webassemblyjs/ast/lib/index.js118
-rw-r--r--node_modules/@webassemblyjs/ast/lib/node-helpers.js107
-rw-r--r--node_modules/@webassemblyjs/ast/lib/node-path.js144
-rw-r--r--node_modules/@webassemblyjs/ast/lib/nodes.js1134
-rw-r--r--node_modules/@webassemblyjs/ast/lib/signatures.js207
-rw-r--r--node_modules/@webassemblyjs/ast/lib/transform/denormalize-type-references/index.js83
-rw-r--r--node_modules/@webassemblyjs/ast/lib/transform/wast-identifier-to-index/index.js225
-rw-r--r--node_modules/@webassemblyjs/ast/lib/traverse.js105
-rw-r--r--node_modules/@webassemblyjs/ast/lib/types/basic.js0
-rw-r--r--node_modules/@webassemblyjs/ast/lib/types/nodes.js0
-rw-r--r--node_modules/@webassemblyjs/ast/lib/types/traverse.js0
-rw-r--r--node_modules/@webassemblyjs/ast/lib/utils.js306
-rw-r--r--node_modules/@webassemblyjs/ast/package.json73
-rw-r--r--node_modules/@webassemblyjs/ast/scripts/generateNodeUtils.js219
-rw-r--r--node_modules/@webassemblyjs/ast/scripts/generateTypeDefinitions.js47
-rw-r--r--node_modules/@webassemblyjs/ast/scripts/util.js38
34 files changed, 6341 insertions, 0 deletions
diff --git a/node_modules/@webassemblyjs/ast/LICENSE b/node_modules/@webassemblyjs/ast/LICENSE
new file mode 100644
index 0000000..87e7e1f
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Sven Sauleau <sven@sauleau.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/@webassemblyjs/ast/README.md b/node_modules/@webassemblyjs/ast/README.md
new file mode 100644
index 0000000..7560244
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/README.md
@@ -0,0 +1,167 @@
+# @webassemblyjs/ast
+
+> AST utils for webassemblyjs
+
+## Installation
+
+```sh
+yarn add @webassemblyjs/ast
+```
+
+## Usage
+
+### Traverse
+
+```js
+import { traverse } from "@webassemblyjs/ast";
+
+traverse(ast, {
+ Module(path) {
+ console.log(path.node);
+ }
+});
+```
+
+### Instruction signatures
+
+```js
+import { signatures } from "@webassemblyjs/ast";
+
+console.log(signatures);
+```
+
+### Path methods
+
+- `findParent: NodeLocator`
+- `replaceWith: Node => void`
+- `remove: () => void`
+- `insertBefore: Node => void`
+- `insertAfter: Node => void`
+- `stop: () => void`
+
+### AST utils
+
+- function `module(id, fields, metadata)`
+- function `moduleMetadata(sections, functionNames, localNames)`
+- function `moduleNameMetadata(value)`
+- function `functionNameMetadata(value, index)`
+- function `localNameMetadata(value, localIndex, functionIndex)`
+- function `binaryModule(id, blob)`
+- function `quoteModule(id, string)`
+- function `sectionMetadata(section, startOffset, size, vectorOfSize)`
+- function `loopInstruction(label, resulttype, instr)`
+- function `instruction(id, args, namedArgs)`
+- function `objectInstruction(id, object, args, namedArgs)`
+- function `ifInstruction(testLabel, test, result, consequent, alternate)`
+- function `stringLiteral(value)`
+- function `numberLiteralFromRaw(value, raw)`
+- function `longNumberLiteral(value, raw)`
+- function `floatLiteral(value, nan, inf, raw)`
+- function `elem(table, offset, funcs)`
+- function `indexInFuncSection(index)`
+- function `valtypeLiteral(name)`
+- function `typeInstruction(id, functype)`
+- function `start(index)`
+- function `globalType(valtype, mutability)`
+- function `leadingComment(value)`
+- function `blockComment(value)`
+- function `data(memoryIndex, offset, init)`
+- function `global(globalType, init, name)`
+- function `table(elementType, limits, name, elements)`
+- function `memory(limits, id)`
+- function `funcImportDescr(id, signature)`
+- function `moduleImport(module, name, descr)`
+- function `moduleExportDescr(exportType, id)`
+- function `moduleExport(name, descr)`
+- function `limit(min, max)`
+- function `signature(params, results)`
+- function `program(body)`
+- function `identifier(value, raw)`
+- function `blockInstruction(label, instr, result)`
+- function `callInstruction(index, instrArgs)`
+- function `callIndirectInstruction(signature, intrs)`
+- function `byteArray(values)`
+- function `func(name, signature, body, isExternal, metadata)`
+- Constant`isModule`
+- Constant`isModuleMetadata`
+- Constant`isModuleNameMetadata`
+- Constant`isFunctionNameMetadata`
+- Constant`isLocalNameMetadata`
+- Constant`isBinaryModule`
+- Constant`isQuoteModule`
+- Constant`isSectionMetadata`
+- Constant`isLoopInstruction`
+- Constant`isInstruction`
+- Constant`isObjectInstruction`
+- Constant`isIfInstruction`
+- Constant`isStringLiteral`
+- Constant`isNumberLiteral`
+- Constant`isLongNumberLiteral`
+- Constant`isFloatLiteral`
+- Constant`isElem`
+- Constant`isIndexInFuncSection`
+- Constant`isValtypeLiteral`
+- Constant`isTypeInstruction`
+- Constant`isStart`
+- Constant`isGlobalType`
+- Constant`isLeadingComment`
+- Constant`isBlockComment`
+- Constant`isData`
+- Constant`isGlobal`
+- Constant`isTable`
+- Constant`isMemory`
+- Constant`isFuncImportDescr`
+- Constant`isModuleImport`
+- Constant`isModuleExportDescr`
+- Constant`isModuleExport`
+- Constant`isLimit`
+- Constant`isSignature`
+- Constant`isProgram`
+- Constant`isIdentifier`
+- Constant`isBlockInstruction`
+- Constant`isCallInstruction`
+- Constant`isCallIndirectInstruction`
+- Constant`isByteArray`
+- Constant`isFunc`
+- Constant`assertModule`
+- Constant`assertModuleMetadata`
+- Constant`assertModuleNameMetadata`
+- Constant`assertFunctionNameMetadata`
+- Constant`assertLocalNameMetadata`
+- Constant`assertBinaryModule`
+- Constant`assertQuoteModule`
+- Constant`assertSectionMetadata`
+- Constant`assertLoopInstruction`
+- Constant`assertInstruction`
+- Constant`assertObjectInstruction`
+- Constant`assertIfInstruction`
+- Constant`assertStringLiteral`
+- Constant`assertNumberLiteral`
+- Constant`assertLongNumberLiteral`
+- Constant`assertFloatLiteral`
+- Constant`assertElem`
+- Constant`assertIndexInFuncSection`
+- Constant`assertValtypeLiteral`
+- Constant`assertTypeInstruction`
+- Constant`assertStart`
+- Constant`assertGlobalType`
+- Constant`assertLeadingComment`
+- Constant`assertBlockComment`
+- Constant`assertData`
+- Constant`assertGlobal`
+- Constant`assertTable`
+- Constant`assertMemory`
+- Constant`assertFuncImportDescr`
+- Constant`assertModuleImport`
+- Constant`assertModuleExportDescr`
+- Constant`assertModuleExport`
+- Constant`assertLimit`
+- Constant`assertSignature`
+- Constant`assertProgram`
+- Constant`assertIdentifier`
+- Constant`assertBlockInstruction`
+- Constant`assertCallInstruction`
+- Constant`assertCallIndirectInstruction`
+- Constant`assertByteArray`
+- Constant`assertFunc`
+
diff --git a/node_modules/@webassemblyjs/ast/esm/clone.js b/node_modules/@webassemblyjs/ast/esm/clone.js
new file mode 100644
index 0000000..92c3f5f
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/clone.js
@@ -0,0 +1,10 @@
+export function cloneNode(n) {
+ // $FlowIgnore
+ var newObj = {};
+
+ for (var k in n) {
+ newObj[k] = n[k];
+ }
+
+ return newObj;
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/esm/definitions.js b/node_modules/@webassemblyjs/ast/esm/definitions.js
new file mode 100644
index 0000000..120311b
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/definitions.js
@@ -0,0 +1,663 @@
+var definitions = {};
+
+function defineType(typeName, metadata) {
+ definitions[typeName] = metadata;
+}
+
+defineType("Module", {
+ spec: {
+ wasm: "https://webassembly.github.io/spec/core/binary/modules.html#binary-module",
+ wat: "https://webassembly.github.io/spec/core/text/modules.html#text-module"
+ },
+ doc: "A module consists of a sequence of sections (termed fields in the text format).",
+ unionType: ["Node"],
+ fields: {
+ id: {
+ maybe: true,
+ type: "string"
+ },
+ fields: {
+ array: true,
+ type: "Node"
+ },
+ metadata: {
+ optional: true,
+ type: "ModuleMetadata"
+ }
+ }
+});
+defineType("ModuleMetadata", {
+ unionType: ["Node"],
+ fields: {
+ sections: {
+ array: true,
+ type: "SectionMetadata"
+ },
+ functionNames: {
+ optional: true,
+ array: true,
+ type: "FunctionNameMetadata"
+ },
+ localNames: {
+ optional: true,
+ array: true,
+ type: "ModuleMetadata"
+ },
+ producers: {
+ optional: true,
+ array: true,
+ type: "ProducersSectionMetadata"
+ }
+ }
+});
+defineType("ModuleNameMetadata", {
+ unionType: ["Node"],
+ fields: {
+ value: {
+ type: "string"
+ }
+ }
+});
+defineType("FunctionNameMetadata", {
+ unionType: ["Node"],
+ fields: {
+ value: {
+ type: "string"
+ },
+ index: {
+ type: "number"
+ }
+ }
+});
+defineType("LocalNameMetadata", {
+ unionType: ["Node"],
+ fields: {
+ value: {
+ type: "string"
+ },
+ localIndex: {
+ type: "number"
+ },
+ functionIndex: {
+ type: "number"
+ }
+ }
+});
+defineType("BinaryModule", {
+ unionType: ["Node"],
+ fields: {
+ id: {
+ maybe: true,
+ type: "string"
+ },
+ blob: {
+ array: true,
+ type: "string"
+ }
+ }
+});
+defineType("QuoteModule", {
+ unionType: ["Node"],
+ fields: {
+ id: {
+ maybe: true,
+ type: "string"
+ },
+ string: {
+ array: true,
+ type: "string"
+ }
+ }
+});
+defineType("SectionMetadata", {
+ unionType: ["Node"],
+ fields: {
+ section: {
+ type: "SectionName"
+ },
+ startOffset: {
+ type: "number"
+ },
+ size: {
+ type: "NumberLiteral"
+ },
+ vectorOfSize: {
+ comment: "Size of the vector in the section (if any)",
+ type: "NumberLiteral"
+ }
+ }
+});
+defineType("ProducersSectionMetadata", {
+ unionType: ["Node"],
+ fields: {
+ producers: {
+ array: true,
+ type: "ProducerMetadata"
+ }
+ }
+});
+defineType("ProducerMetadata", {
+ unionType: ["Node"],
+ fields: {
+ language: {
+ type: "ProducerMetadataVersionedName",
+ array: true
+ },
+ processedBy: {
+ type: "ProducerMetadataVersionedName",
+ array: true
+ },
+ sdk: {
+ type: "ProducerMetadataVersionedName",
+ array: true
+ }
+ }
+});
+defineType("ProducerMetadataVersionedName", {
+ unionType: ["Node"],
+ fields: {
+ name: {
+ type: "string"
+ },
+ version: {
+ type: "string"
+ }
+ }
+});
+/*
+Instructions
+*/
+
+defineType("LoopInstruction", {
+ unionType: ["Node", "Block", "Instruction"],
+ fields: {
+ id: {
+ constant: true,
+ type: "string",
+ value: "loop"
+ },
+ label: {
+ maybe: true,
+ type: "Identifier"
+ },
+ resulttype: {
+ maybe: true,
+ type: "Valtype"
+ },
+ instr: {
+ array: true,
+ type: "Instruction"
+ }
+ }
+});
+defineType("Instr", {
+ unionType: ["Node", "Expression", "Instruction"],
+ fields: {
+ id: {
+ type: "string"
+ },
+ object: {
+ optional: true,
+ type: "Valtype"
+ },
+ args: {
+ array: true,
+ type: "Expression"
+ },
+ namedArgs: {
+ optional: true,
+ type: "Object"
+ }
+ }
+});
+defineType("IfInstruction", {
+ unionType: ["Node", "Instruction"],
+ fields: {
+ id: {
+ constant: true,
+ type: "string",
+ value: "if"
+ },
+ testLabel: {
+ comment: "only for WAST",
+ type: "Identifier"
+ },
+ test: {
+ array: true,
+ type: "Instruction"
+ },
+ result: {
+ maybe: true,
+ type: "Valtype"
+ },
+ consequent: {
+ array: true,
+ type: "Instruction"
+ },
+ alternate: {
+ array: true,
+ type: "Instruction"
+ }
+ }
+});
+/*
+Concrete value types
+*/
+
+defineType("StringLiteral", {
+ unionType: ["Node", "Expression"],
+ fields: {
+ value: {
+ type: "string"
+ }
+ }
+});
+defineType("NumberLiteral", {
+ unionType: ["Node", "NumericLiteral", "Expression"],
+ fields: {
+ value: {
+ type: "number"
+ },
+ raw: {
+ type: "string"
+ }
+ }
+});
+defineType("LongNumberLiteral", {
+ unionType: ["Node", "NumericLiteral", "Expression"],
+ fields: {
+ value: {
+ type: "LongNumber"
+ },
+ raw: {
+ type: "string"
+ }
+ }
+});
+defineType("FloatLiteral", {
+ unionType: ["Node", "NumericLiteral", "Expression"],
+ fields: {
+ value: {
+ type: "number"
+ },
+ nan: {
+ optional: true,
+ type: "boolean"
+ },
+ inf: {
+ optional: true,
+ type: "boolean"
+ },
+ raw: {
+ type: "string"
+ }
+ }
+});
+defineType("Elem", {
+ unionType: ["Node"],
+ fields: {
+ table: {
+ type: "Index"
+ },
+ offset: {
+ array: true,
+ type: "Instruction"
+ },
+ funcs: {
+ array: true,
+ type: "Index"
+ }
+ }
+});
+defineType("IndexInFuncSection", {
+ unionType: ["Node"],
+ fields: {
+ index: {
+ type: "Index"
+ }
+ }
+});
+defineType("ValtypeLiteral", {
+ unionType: ["Node", "Expression"],
+ fields: {
+ name: {
+ type: "Valtype"
+ }
+ }
+});
+defineType("TypeInstruction", {
+ unionType: ["Node", "Instruction"],
+ fields: {
+ id: {
+ maybe: true,
+ type: "Index"
+ },
+ functype: {
+ type: "Signature"
+ }
+ }
+});
+defineType("Start", {
+ unionType: ["Node"],
+ fields: {
+ index: {
+ type: "Index"
+ }
+ }
+});
+defineType("GlobalType", {
+ unionType: ["Node", "ImportDescr"],
+ fields: {
+ valtype: {
+ type: "Valtype"
+ },
+ mutability: {
+ type: "Mutability"
+ }
+ }
+});
+defineType("LeadingComment", {
+ unionType: ["Node"],
+ fields: {
+ value: {
+ type: "string"
+ }
+ }
+});
+defineType("BlockComment", {
+ unionType: ["Node"],
+ fields: {
+ value: {
+ type: "string"
+ }
+ }
+});
+defineType("Data", {
+ unionType: ["Node"],
+ fields: {
+ memoryIndex: {
+ type: "Memidx"
+ },
+ offset: {
+ type: "Instruction"
+ },
+ init: {
+ type: "ByteArray"
+ }
+ }
+});
+defineType("Global", {
+ unionType: ["Node"],
+ fields: {
+ globalType: {
+ type: "GlobalType"
+ },
+ init: {
+ array: true,
+ type: "Instruction"
+ },
+ name: {
+ maybe: true,
+ type: "Identifier"
+ }
+ }
+});
+defineType("Table", {
+ unionType: ["Node", "ImportDescr"],
+ fields: {
+ elementType: {
+ type: "TableElementType"
+ },
+ limits: {
+ assertNodeType: true,
+ type: "Limit"
+ },
+ name: {
+ maybe: true,
+ type: "Identifier"
+ },
+ elements: {
+ array: true,
+ optional: true,
+ type: "Index"
+ }
+ }
+});
+defineType("Memory", {
+ unionType: ["Node", "ImportDescr"],
+ fields: {
+ limits: {
+ type: "Limit"
+ },
+ id: {
+ maybe: true,
+ type: "Index"
+ }
+ }
+});
+defineType("FuncImportDescr", {
+ unionType: ["Node", "ImportDescr"],
+ fields: {
+ id: {
+ type: "Identifier"
+ },
+ signature: {
+ type: "Signature"
+ }
+ }
+});
+defineType("ModuleImport", {
+ unionType: ["Node"],
+ fields: {
+ module: {
+ type: "string"
+ },
+ name: {
+ type: "string"
+ },
+ descr: {
+ type: "ImportDescr"
+ }
+ }
+});
+defineType("ModuleExportDescr", {
+ unionType: ["Node"],
+ fields: {
+ exportType: {
+ type: "ExportDescrType"
+ },
+ id: {
+ type: "Index"
+ }
+ }
+});
+defineType("ModuleExport", {
+ unionType: ["Node"],
+ fields: {
+ name: {
+ type: "string"
+ },
+ descr: {
+ type: "ModuleExportDescr"
+ }
+ }
+});
+defineType("Limit", {
+ unionType: ["Node"],
+ fields: {
+ min: {
+ type: "number"
+ },
+ max: {
+ optional: true,
+ type: "number"
+ }
+ }
+});
+defineType("Signature", {
+ unionType: ["Node"],
+ fields: {
+ params: {
+ array: true,
+ type: "FuncParam"
+ },
+ results: {
+ array: true,
+ type: "Valtype"
+ }
+ }
+});
+defineType("Program", {
+ unionType: ["Node"],
+ fields: {
+ body: {
+ array: true,
+ type: "Node"
+ }
+ }
+});
+defineType("Identifier", {
+ unionType: ["Node", "Expression"],
+ fields: {
+ value: {
+ type: "string"
+ },
+ raw: {
+ optional: true,
+ type: "string"
+ }
+ }
+});
+defineType("BlockInstruction", {
+ unionType: ["Node", "Block", "Instruction"],
+ fields: {
+ id: {
+ constant: true,
+ type: "string",
+ value: "block"
+ },
+ label: {
+ maybe: true,
+ type: "Identifier"
+ },
+ instr: {
+ array: true,
+ type: "Instruction"
+ },
+ result: {
+ maybe: true,
+ type: "Valtype"
+ }
+ }
+});
+defineType("CallInstruction", {
+ unionType: ["Node", "Instruction"],
+ fields: {
+ id: {
+ constant: true,
+ type: "string",
+ value: "call"
+ },
+ index: {
+ type: "Index"
+ },
+ instrArgs: {
+ array: true,
+ optional: true,
+ type: "Expression"
+ },
+ numeric: {
+ type: "Index",
+ optional: true
+ }
+ }
+});
+defineType("CallIndirectInstruction", {
+ unionType: ["Node", "Instruction"],
+ fields: {
+ id: {
+ constant: true,
+ type: "string",
+ value: "call_indirect"
+ },
+ signature: {
+ type: "SignatureOrTypeRef"
+ },
+ intrs: {
+ array: true,
+ optional: true,
+ type: "Expression"
+ }
+ }
+});
+defineType("ByteArray", {
+ unionType: ["Node"],
+ fields: {
+ values: {
+ array: true,
+ type: "Byte"
+ }
+ }
+});
+defineType("Func", {
+ unionType: ["Node", "Block"],
+ fields: {
+ name: {
+ maybe: true,
+ type: "Index"
+ },
+ signature: {
+ type: "SignatureOrTypeRef"
+ },
+ body: {
+ array: true,
+ type: "Instruction"
+ },
+ isExternal: {
+ comment: "means that it has been imported from the outside js",
+ optional: true,
+ type: "boolean"
+ },
+ metadata: {
+ optional: true,
+ type: "FuncMetadata"
+ }
+ }
+});
+/**
+ * Intrinsics
+ */
+
+defineType("InternalBrUnless", {
+ unionType: ["Node", "Intrinsic"],
+ fields: {
+ target: {
+ type: "number"
+ }
+ }
+});
+defineType("InternalGoto", {
+ unionType: ["Node", "Intrinsic"],
+ fields: {
+ target: {
+ type: "number"
+ }
+ }
+});
+defineType("InternalCallExtern", {
+ unionType: ["Node", "Intrinsic"],
+ fields: {
+ target: {
+ type: "number"
+ }
+ }
+}); // function bodies are terminated by an `end` instruction but are missing a
+// return instruction
+//
+// Since we can't inject a new instruction we are injecting a new instruction.
+
+defineType("InternalEndAndReturn", {
+ unionType: ["Node", "Intrinsic"],
+ fields: {}
+});
+module.exports = definitions; \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/esm/index.js b/node_modules/@webassemblyjs/ast/esm/index.js
new file mode 100644
index 0000000..3bce891
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/index.js
@@ -0,0 +1,6 @@
+export * from "./nodes";
+export { numberLiteralFromRaw, withLoc, withRaw, funcParam, indexLiteral, memIndexLiteral, instruction, objectInstruction } from "./node-helpers.js";
+export { traverse } from "./traverse";
+export { signatures } from "./signatures";
+export * from "./utils";
+export { cloneNode } from "./clone"; \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/esm/node-helpers.js b/node_modules/@webassemblyjs/ast/esm/node-helpers.js
new file mode 100644
index 0000000..fb91cae
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/node-helpers.js
@@ -0,0 +1,84 @@
+import { parse32F, parse64F, parse32I, parse64I, parseU32, isNanLiteral, isInfLiteral } from "@webassemblyjs/wast-parser";
+import { longNumberLiteral, floatLiteral, numberLiteral, instr } from "./nodes";
+export function numberLiteralFromRaw(rawValue) {
+ var instructionType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "i32";
+ var original = rawValue; // Remove numeric separators _
+
+ if (typeof rawValue === "string") {
+ rawValue = rawValue.replace(/_/g, "");
+ }
+
+ if (typeof rawValue === "number") {
+ return numberLiteral(rawValue, String(original));
+ } else {
+ switch (instructionType) {
+ case "i32":
+ {
+ return numberLiteral(parse32I(rawValue), String(original));
+ }
+
+ case "u32":
+ {
+ return numberLiteral(parseU32(rawValue), String(original));
+ }
+
+ case "i64":
+ {
+ return longNumberLiteral(parse64I(rawValue), String(original));
+ }
+
+ case "f32":
+ {
+ return floatLiteral(parse32F(rawValue), isNanLiteral(rawValue), isInfLiteral(rawValue), String(original));
+ }
+ // f64
+
+ default:
+ {
+ return floatLiteral(parse64F(rawValue), isNanLiteral(rawValue), isInfLiteral(rawValue), String(original));
+ }
+ }
+ }
+}
+export function instruction(id) {
+ var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
+ var namedArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+ return instr(id, undefined, args, namedArgs);
+}
+export function objectInstruction(id, object) {
+ var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
+ var namedArgs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ return instr(id, object, args, namedArgs);
+}
+/**
+ * Decorators
+ */
+
+export function withLoc(n, end, start) {
+ var loc = {
+ start: start,
+ end: end
+ };
+ n.loc = loc;
+ return n;
+}
+export function withRaw(n, raw) {
+ n.raw = raw;
+ return n;
+}
+export function funcParam(valtype, id) {
+ return {
+ id: id,
+ valtype: valtype
+ };
+}
+export function indexLiteral(value) {
+ // $FlowIgnore
+ var x = numberLiteralFromRaw(value, "u32");
+ return x;
+}
+export function memIndexLiteral(value) {
+ // $FlowIgnore
+ var x = numberLiteralFromRaw(value, "u32");
+ return x;
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/esm/node-path.js b/node_modules/@webassemblyjs/ast/esm/node-path.js
new file mode 100644
index 0000000..99909ae
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/node-path.js
@@ -0,0 +1,137 @@
+function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
+
+function findParent(_ref, cb) {
+ var parentPath = _ref.parentPath;
+
+ if (parentPath == null) {
+ throw new Error("node is root");
+ }
+
+ var currentPath = parentPath;
+
+ while (cb(currentPath) !== false) {
+ // Hit the root node, stop
+ // $FlowIgnore
+ if (currentPath.parentPath == null) {
+ return null;
+ } // $FlowIgnore
+
+
+ currentPath = currentPath.parentPath;
+ }
+
+ return currentPath.node;
+}
+
+function insertBefore(context, newNode) {
+ return insert(context, newNode);
+}
+
+function insertAfter(context, newNode) {
+ return insert(context, newNode, 1);
+}
+
+function insert(_ref2, newNode) {
+ var node = _ref2.node,
+ inList = _ref2.inList,
+ parentPath = _ref2.parentPath,
+ parentKey = _ref2.parentKey;
+ var indexOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
+
+ if (!inList) {
+ throw new Error('inList' + " error: " + ("insert can only be used for nodes that are within lists" || "unknown"));
+ }
+
+ if (!(parentPath != null)) {
+ throw new Error('parentPath != null' + " error: " + ("Can not remove root node" || "unknown"));
+ }
+
+ // $FlowIgnore
+ var parentList = parentPath.node[parentKey];
+ var indexInList = parentList.findIndex(function (n) {
+ return n === node;
+ });
+ parentList.splice(indexInList + indexOffset, 0, newNode);
+}
+
+function remove(_ref3) {
+ var node = _ref3.node,
+ parentKey = _ref3.parentKey,
+ parentPath = _ref3.parentPath;
+
+ if (!(parentPath != null)) {
+ throw new Error('parentPath != null' + " error: " + ("Can not remove root node" || "unknown"));
+ }
+
+ // $FlowIgnore
+ var parentNode = parentPath.node; // $FlowIgnore
+
+ var parentProperty = parentNode[parentKey];
+
+ if (Array.isArray(parentProperty)) {
+ // $FlowIgnore
+ parentNode[parentKey] = parentProperty.filter(function (n) {
+ return n !== node;
+ });
+ } else {
+ // $FlowIgnore
+ delete parentNode[parentKey];
+ }
+
+ node._deleted = true;
+}
+
+function stop(context) {
+ context.shouldStop = true;
+}
+
+function replaceWith(context, newNode) {
+ // $FlowIgnore
+ var parentNode = context.parentPath.node; // $FlowIgnore
+
+ var parentProperty = parentNode[context.parentKey];
+
+ if (Array.isArray(parentProperty)) {
+ var indexInList = parentProperty.findIndex(function (n) {
+ return n === context.node;
+ });
+ parentProperty.splice(indexInList, 1, newNode);
+ } else {
+ // $FlowIgnore
+ parentNode[context.parentKey] = newNode;
+ }
+
+ context.node._deleted = true;
+ context.node = newNode;
+} // bind the context to the first argument of node operations
+
+
+function bindNodeOperations(operations, context) {
+ var keys = Object.keys(operations);
+ var boundOperations = {};
+ keys.forEach(function (key) {
+ boundOperations[key] = operations[key].bind(null, context);
+ });
+ return boundOperations;
+}
+
+function createPathOperations(context) {
+ // $FlowIgnore
+ return bindNodeOperations({
+ findParent: findParent,
+ replaceWith: replaceWith,
+ remove: remove,
+ insertBefore: insertBefore,
+ insertAfter: insertAfter,
+ stop: stop
+ }, context);
+}
+
+export function createPath(context) {
+ var path = _extends({}, context); // $FlowIgnore
+
+
+ Object.assign(path, createPathOperations(path)); // $FlowIgnore
+
+ return path;
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/esm/nodes.js b/node_modules/@webassemblyjs/ast/esm/nodes.js
new file mode 100644
index 0000000..0f70793
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/nodes.js
@@ -0,0 +1,915 @@
+function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
+// THIS FILE IS AUTOGENERATED
+// see scripts/generateNodeUtils.js
+function isTypeOf(t) {
+ return function (n) {
+ return n.type === t;
+ };
+}
+
+function assertTypeOf(t) {
+ return function (n) {
+ return function () {
+ if (!(n.type === t)) {
+ throw new Error('n.type === t' + " error: " + (undefined || "unknown"));
+ }
+ }();
+ };
+}
+
+export function module(id, fields, metadata) {
+ if (id !== null && id !== undefined) {
+ if (!(typeof id === "string")) {
+ throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
+ }
+ }
+
+ if (!(_typeof(fields) === "object" && typeof fields.length !== "undefined")) {
+ throw new Error('typeof fields === "object" && typeof fields.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "Module",
+ id: id,
+ fields: fields
+ };
+
+ if (typeof metadata !== "undefined") {
+ node.metadata = metadata;
+ }
+
+ return node;
+}
+export function moduleMetadata(sections, functionNames, localNames, producers) {
+ if (!(_typeof(sections) === "object" && typeof sections.length !== "undefined")) {
+ throw new Error('typeof sections === "object" && typeof sections.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (functionNames !== null && functionNames !== undefined) {
+ if (!(_typeof(functionNames) === "object" && typeof functionNames.length !== "undefined")) {
+ throw new Error('typeof functionNames === "object" && typeof functionNames.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+ }
+
+ if (localNames !== null && localNames !== undefined) {
+ if (!(_typeof(localNames) === "object" && typeof localNames.length !== "undefined")) {
+ throw new Error('typeof localNames === "object" && typeof localNames.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+ }
+
+ if (producers !== null && producers !== undefined) {
+ if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) {
+ throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "ModuleMetadata",
+ sections: sections
+ };
+
+ if (typeof functionNames !== "undefined" && functionNames.length > 0) {
+ node.functionNames = functionNames;
+ }
+
+ if (typeof localNames !== "undefined" && localNames.length > 0) {
+ node.localNames = localNames;
+ }
+
+ if (typeof producers !== "undefined" && producers.length > 0) {
+ node.producers = producers;
+ }
+
+ return node;
+}
+export function moduleNameMetadata(value) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ var node = {
+ type: "ModuleNameMetadata",
+ value: value
+ };
+ return node;
+}
+export function functionNameMetadata(value, index) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ if (!(typeof index === "number")) {
+ throw new Error('typeof index === "number"' + " error: " + ("Argument index must be of type number, given: " + _typeof(index) || "unknown"));
+ }
+
+ var node = {
+ type: "FunctionNameMetadata",
+ value: value,
+ index: index
+ };
+ return node;
+}
+export function localNameMetadata(value, localIndex, functionIndex) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ if (!(typeof localIndex === "number")) {
+ throw new Error('typeof localIndex === "number"' + " error: " + ("Argument localIndex must be of type number, given: " + _typeof(localIndex) || "unknown"));
+ }
+
+ if (!(typeof functionIndex === "number")) {
+ throw new Error('typeof functionIndex === "number"' + " error: " + ("Argument functionIndex must be of type number, given: " + _typeof(functionIndex) || "unknown"));
+ }
+
+ var node = {
+ type: "LocalNameMetadata",
+ value: value,
+ localIndex: localIndex,
+ functionIndex: functionIndex
+ };
+ return node;
+}
+export function binaryModule(id, blob) {
+ if (id !== null && id !== undefined) {
+ if (!(typeof id === "string")) {
+ throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
+ }
+ }
+
+ if (!(_typeof(blob) === "object" && typeof blob.length !== "undefined")) {
+ throw new Error('typeof blob === "object" && typeof blob.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "BinaryModule",
+ id: id,
+ blob: blob
+ };
+ return node;
+}
+export function quoteModule(id, string) {
+ if (id !== null && id !== undefined) {
+ if (!(typeof id === "string")) {
+ throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
+ }
+ }
+
+ if (!(_typeof(string) === "object" && typeof string.length !== "undefined")) {
+ throw new Error('typeof string === "object" && typeof string.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "QuoteModule",
+ id: id,
+ string: string
+ };
+ return node;
+}
+export function sectionMetadata(section, startOffset, size, vectorOfSize) {
+ if (!(typeof startOffset === "number")) {
+ throw new Error('typeof startOffset === "number"' + " error: " + ("Argument startOffset must be of type number, given: " + _typeof(startOffset) || "unknown"));
+ }
+
+ var node = {
+ type: "SectionMetadata",
+ section: section,
+ startOffset: startOffset,
+ size: size,
+ vectorOfSize: vectorOfSize
+ };
+ return node;
+}
+export function producersSectionMetadata(producers) {
+ if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) {
+ throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "ProducersSectionMetadata",
+ producers: producers
+ };
+ return node;
+}
+export function producerMetadata(language, processedBy, sdk) {
+ if (!(_typeof(language) === "object" && typeof language.length !== "undefined")) {
+ throw new Error('typeof language === "object" && typeof language.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (!(_typeof(processedBy) === "object" && typeof processedBy.length !== "undefined")) {
+ throw new Error('typeof processedBy === "object" && typeof processedBy.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (!(_typeof(sdk) === "object" && typeof sdk.length !== "undefined")) {
+ throw new Error('typeof sdk === "object" && typeof sdk.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "ProducerMetadata",
+ language: language,
+ processedBy: processedBy,
+ sdk: sdk
+ };
+ return node;
+}
+export function producerMetadataVersionedName(name, version) {
+ if (!(typeof name === "string")) {
+ throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
+ }
+
+ if (!(typeof version === "string")) {
+ throw new Error('typeof version === "string"' + " error: " + ("Argument version must be of type string, given: " + _typeof(version) || "unknown"));
+ }
+
+ var node = {
+ type: "ProducerMetadataVersionedName",
+ name: name,
+ version: version
+ };
+ return node;
+}
+export function loopInstruction(label, resulttype, instr) {
+ if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) {
+ throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "LoopInstruction",
+ id: "loop",
+ label: label,
+ resulttype: resulttype,
+ instr: instr
+ };
+ return node;
+}
+export function instr(id, object, args, namedArgs) {
+ if (!(typeof id === "string")) {
+ throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
+ }
+
+ if (!(_typeof(args) === "object" && typeof args.length !== "undefined")) {
+ throw new Error('typeof args === "object" && typeof args.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "Instr",
+ id: id,
+ args: args
+ };
+
+ if (typeof object !== "undefined") {
+ node.object = object;
+ }
+
+ if (typeof namedArgs !== "undefined" && Object.keys(namedArgs).length !== 0) {
+ node.namedArgs = namedArgs;
+ }
+
+ return node;
+}
+export function ifInstruction(testLabel, test, result, consequent, alternate) {
+ if (!(_typeof(test) === "object" && typeof test.length !== "undefined")) {
+ throw new Error('typeof test === "object" && typeof test.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (!(_typeof(consequent) === "object" && typeof consequent.length !== "undefined")) {
+ throw new Error('typeof consequent === "object" && typeof consequent.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (!(_typeof(alternate) === "object" && typeof alternate.length !== "undefined")) {
+ throw new Error('typeof alternate === "object" && typeof alternate.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "IfInstruction",
+ id: "if",
+ testLabel: testLabel,
+ test: test,
+ result: result,
+ consequent: consequent,
+ alternate: alternate
+ };
+ return node;
+}
+export function stringLiteral(value) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ var node = {
+ type: "StringLiteral",
+ value: value
+ };
+ return node;
+}
+export function numberLiteral(value, raw) {
+ if (!(typeof value === "number")) {
+ throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown"));
+ }
+
+ if (!(typeof raw === "string")) {
+ throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
+ }
+
+ var node = {
+ type: "NumberLiteral",
+ value: value,
+ raw: raw
+ };
+ return node;
+}
+export function longNumberLiteral(value, raw) {
+ if (!(typeof raw === "string")) {
+ throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
+ }
+
+ var node = {
+ type: "LongNumberLiteral",
+ value: value,
+ raw: raw
+ };
+ return node;
+}
+export function floatLiteral(value, nan, inf, raw) {
+ if (!(typeof value === "number")) {
+ throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown"));
+ }
+
+ if (nan !== null && nan !== undefined) {
+ if (!(typeof nan === "boolean")) {
+ throw new Error('typeof nan === "boolean"' + " error: " + ("Argument nan must be of type boolean, given: " + _typeof(nan) || "unknown"));
+ }
+ }
+
+ if (inf !== null && inf !== undefined) {
+ if (!(typeof inf === "boolean")) {
+ throw new Error('typeof inf === "boolean"' + " error: " + ("Argument inf must be of type boolean, given: " + _typeof(inf) || "unknown"));
+ }
+ }
+
+ if (!(typeof raw === "string")) {
+ throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
+ }
+
+ var node = {
+ type: "FloatLiteral",
+ value: value,
+ raw: raw
+ };
+
+ if (nan === true) {
+ node.nan = true;
+ }
+
+ if (inf === true) {
+ node.inf = true;
+ }
+
+ return node;
+}
+export function elem(table, offset, funcs) {
+ if (!(_typeof(offset) === "object" && typeof offset.length !== "undefined")) {
+ throw new Error('typeof offset === "object" && typeof offset.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (!(_typeof(funcs) === "object" && typeof funcs.length !== "undefined")) {
+ throw new Error('typeof funcs === "object" && typeof funcs.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "Elem",
+ table: table,
+ offset: offset,
+ funcs: funcs
+ };
+ return node;
+}
+export function indexInFuncSection(index) {
+ var node = {
+ type: "IndexInFuncSection",
+ index: index
+ };
+ return node;
+}
+export function valtypeLiteral(name) {
+ var node = {
+ type: "ValtypeLiteral",
+ name: name
+ };
+ return node;
+}
+export function typeInstruction(id, functype) {
+ var node = {
+ type: "TypeInstruction",
+ id: id,
+ functype: functype
+ };
+ return node;
+}
+export function start(index) {
+ var node = {
+ type: "Start",
+ index: index
+ };
+ return node;
+}
+export function globalType(valtype, mutability) {
+ var node = {
+ type: "GlobalType",
+ valtype: valtype,
+ mutability: mutability
+ };
+ return node;
+}
+export function leadingComment(value) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ var node = {
+ type: "LeadingComment",
+ value: value
+ };
+ return node;
+}
+export function blockComment(value) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ var node = {
+ type: "BlockComment",
+ value: value
+ };
+ return node;
+}
+export function data(memoryIndex, offset, init) {
+ var node = {
+ type: "Data",
+ memoryIndex: memoryIndex,
+ offset: offset,
+ init: init
+ };
+ return node;
+}
+export function global(globalType, init, name) {
+ if (!(_typeof(init) === "object" && typeof init.length !== "undefined")) {
+ throw new Error('typeof init === "object" && typeof init.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "Global",
+ globalType: globalType,
+ init: init,
+ name: name
+ };
+ return node;
+}
+export function table(elementType, limits, name, elements) {
+ if (!(limits.type === "Limit")) {
+ throw new Error('limits.type === "Limit"' + " error: " + ("Argument limits must be of type Limit, given: " + limits.type || "unknown"));
+ }
+
+ if (elements !== null && elements !== undefined) {
+ if (!(_typeof(elements) === "object" && typeof elements.length !== "undefined")) {
+ throw new Error('typeof elements === "object" && typeof elements.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "Table",
+ elementType: elementType,
+ limits: limits,
+ name: name
+ };
+
+ if (typeof elements !== "undefined" && elements.length > 0) {
+ node.elements = elements;
+ }
+
+ return node;
+}
+export function memory(limits, id) {
+ var node = {
+ type: "Memory",
+ limits: limits,
+ id: id
+ };
+ return node;
+}
+export function funcImportDescr(id, signature) {
+ var node = {
+ type: "FuncImportDescr",
+ id: id,
+ signature: signature
+ };
+ return node;
+}
+export function moduleImport(module, name, descr) {
+ if (!(typeof module === "string")) {
+ throw new Error('typeof module === "string"' + " error: " + ("Argument module must be of type string, given: " + _typeof(module) || "unknown"));
+ }
+
+ if (!(typeof name === "string")) {
+ throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
+ }
+
+ var node = {
+ type: "ModuleImport",
+ module: module,
+ name: name,
+ descr: descr
+ };
+ return node;
+}
+export function moduleExportDescr(exportType, id) {
+ var node = {
+ type: "ModuleExportDescr",
+ exportType: exportType,
+ id: id
+ };
+ return node;
+}
+export function moduleExport(name, descr) {
+ if (!(typeof name === "string")) {
+ throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
+ }
+
+ var node = {
+ type: "ModuleExport",
+ name: name,
+ descr: descr
+ };
+ return node;
+}
+export function limit(min, max) {
+ if (!(typeof min === "number")) {
+ throw new Error('typeof min === "number"' + " error: " + ("Argument min must be of type number, given: " + _typeof(min) || "unknown"));
+ }
+
+ if (max !== null && max !== undefined) {
+ if (!(typeof max === "number")) {
+ throw new Error('typeof max === "number"' + " error: " + ("Argument max must be of type number, given: " + _typeof(max) || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "Limit",
+ min: min
+ };
+
+ if (typeof max !== "undefined") {
+ node.max = max;
+ }
+
+ return node;
+}
+export function signature(params, results) {
+ if (!(_typeof(params) === "object" && typeof params.length !== "undefined")) {
+ throw new Error('typeof params === "object" && typeof params.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (!(_typeof(results) === "object" && typeof results.length !== "undefined")) {
+ throw new Error('typeof results === "object" && typeof results.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "Signature",
+ params: params,
+ results: results
+ };
+ return node;
+}
+export function program(body) {
+ if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) {
+ throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "Program",
+ body: body
+ };
+ return node;
+}
+export function identifier(value, raw) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ if (raw !== null && raw !== undefined) {
+ if (!(typeof raw === "string")) {
+ throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "Identifier",
+ value: value
+ };
+
+ if (typeof raw !== "undefined") {
+ node.raw = raw;
+ }
+
+ return node;
+}
+export function blockInstruction(label, instr, result) {
+ if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) {
+ throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "BlockInstruction",
+ id: "block",
+ label: label,
+ instr: instr,
+ result: result
+ };
+ return node;
+}
+export function callInstruction(index, instrArgs, numeric) {
+ if (instrArgs !== null && instrArgs !== undefined) {
+ if (!(_typeof(instrArgs) === "object" && typeof instrArgs.length !== "undefined")) {
+ throw new Error('typeof instrArgs === "object" && typeof instrArgs.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "CallInstruction",
+ id: "call",
+ index: index
+ };
+
+ if (typeof instrArgs !== "undefined" && instrArgs.length > 0) {
+ node.instrArgs = instrArgs;
+ }
+
+ if (typeof numeric !== "undefined") {
+ node.numeric = numeric;
+ }
+
+ return node;
+}
+export function callIndirectInstruction(signature, intrs) {
+ if (intrs !== null && intrs !== undefined) {
+ if (!(_typeof(intrs) === "object" && typeof intrs.length !== "undefined")) {
+ throw new Error('typeof intrs === "object" && typeof intrs.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "CallIndirectInstruction",
+ id: "call_indirect",
+ signature: signature
+ };
+
+ if (typeof intrs !== "undefined" && intrs.length > 0) {
+ node.intrs = intrs;
+ }
+
+ return node;
+}
+export function byteArray(values) {
+ if (!(_typeof(values) === "object" && typeof values.length !== "undefined")) {
+ throw new Error('typeof values === "object" && typeof values.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "ByteArray",
+ values: values
+ };
+ return node;
+}
+export function func(name, signature, body, isExternal, metadata) {
+ if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) {
+ throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (isExternal !== null && isExternal !== undefined) {
+ if (!(typeof isExternal === "boolean")) {
+ throw new Error('typeof isExternal === "boolean"' + " error: " + ("Argument isExternal must be of type boolean, given: " + _typeof(isExternal) || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "Func",
+ name: name,
+ signature: signature,
+ body: body
+ };
+
+ if (isExternal === true) {
+ node.isExternal = true;
+ }
+
+ if (typeof metadata !== "undefined") {
+ node.metadata = metadata;
+ }
+
+ return node;
+}
+export function internalBrUnless(target) {
+ if (!(typeof target === "number")) {
+ throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
+ }
+
+ var node = {
+ type: "InternalBrUnless",
+ target: target
+ };
+ return node;
+}
+export function internalGoto(target) {
+ if (!(typeof target === "number")) {
+ throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
+ }
+
+ var node = {
+ type: "InternalGoto",
+ target: target
+ };
+ return node;
+}
+export function internalCallExtern(target) {
+ if (!(typeof target === "number")) {
+ throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
+ }
+
+ var node = {
+ type: "InternalCallExtern",
+ target: target
+ };
+ return node;
+}
+export function internalEndAndReturn() {
+ var node = {
+ type: "InternalEndAndReturn"
+ };
+ return node;
+}
+export var isModule = isTypeOf("Module");
+export var isModuleMetadata = isTypeOf("ModuleMetadata");
+export var isModuleNameMetadata = isTypeOf("ModuleNameMetadata");
+export var isFunctionNameMetadata = isTypeOf("FunctionNameMetadata");
+export var isLocalNameMetadata = isTypeOf("LocalNameMetadata");
+export var isBinaryModule = isTypeOf("BinaryModule");
+export var isQuoteModule = isTypeOf("QuoteModule");
+export var isSectionMetadata = isTypeOf("SectionMetadata");
+export var isProducersSectionMetadata = isTypeOf("ProducersSectionMetadata");
+export var isProducerMetadata = isTypeOf("ProducerMetadata");
+export var isProducerMetadataVersionedName = isTypeOf("ProducerMetadataVersionedName");
+export var isLoopInstruction = isTypeOf("LoopInstruction");
+export var isInstr = isTypeOf("Instr");
+export var isIfInstruction = isTypeOf("IfInstruction");
+export var isStringLiteral = isTypeOf("StringLiteral");
+export var isNumberLiteral = isTypeOf("NumberLiteral");
+export var isLongNumberLiteral = isTypeOf("LongNumberLiteral");
+export var isFloatLiteral = isTypeOf("FloatLiteral");
+export var isElem = isTypeOf("Elem");
+export var isIndexInFuncSection = isTypeOf("IndexInFuncSection");
+export var isValtypeLiteral = isTypeOf("ValtypeLiteral");
+export var isTypeInstruction = isTypeOf("TypeInstruction");
+export var isStart = isTypeOf("Start");
+export var isGlobalType = isTypeOf("GlobalType");
+export var isLeadingComment = isTypeOf("LeadingComment");
+export var isBlockComment = isTypeOf("BlockComment");
+export var isData = isTypeOf("Data");
+export var isGlobal = isTypeOf("Global");
+export var isTable = isTypeOf("Table");
+export var isMemory = isTypeOf("Memory");
+export var isFuncImportDescr = isTypeOf("FuncImportDescr");
+export var isModuleImport = isTypeOf("ModuleImport");
+export var isModuleExportDescr = isTypeOf("ModuleExportDescr");
+export var isModuleExport = isTypeOf("ModuleExport");
+export var isLimit = isTypeOf("Limit");
+export var isSignature = isTypeOf("Signature");
+export var isProgram = isTypeOf("Program");
+export var isIdentifier = isTypeOf("Identifier");
+export var isBlockInstruction = isTypeOf("BlockInstruction");
+export var isCallInstruction = isTypeOf("CallInstruction");
+export var isCallIndirectInstruction = isTypeOf("CallIndirectInstruction");
+export var isByteArray = isTypeOf("ByteArray");
+export var isFunc = isTypeOf("Func");
+export var isInternalBrUnless = isTypeOf("InternalBrUnless");
+export var isInternalGoto = isTypeOf("InternalGoto");
+export var isInternalCallExtern = isTypeOf("InternalCallExtern");
+export var isInternalEndAndReturn = isTypeOf("InternalEndAndReturn");
+export var isNode = function isNode(node) {
+ return isModule(node) || isModuleMetadata(node) || isModuleNameMetadata(node) || isFunctionNameMetadata(node) || isLocalNameMetadata(node) || isBinaryModule(node) || isQuoteModule(node) || isSectionMetadata(node) || isProducersSectionMetadata(node) || isProducerMetadata(node) || isProducerMetadataVersionedName(node) || isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isElem(node) || isIndexInFuncSection(node) || isValtypeLiteral(node) || isTypeInstruction(node) || isStart(node) || isGlobalType(node) || isLeadingComment(node) || isBlockComment(node) || isData(node) || isGlobal(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node) || isModuleImport(node) || isModuleExportDescr(node) || isModuleExport(node) || isLimit(node) || isSignature(node) || isProgram(node) || isIdentifier(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node) || isByteArray(node) || isFunc(node) || isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node);
+};
+export var isBlock = function isBlock(node) {
+ return isLoopInstruction(node) || isBlockInstruction(node) || isFunc(node);
+};
+export var isInstruction = function isInstruction(node) {
+ return isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isTypeInstruction(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node);
+};
+export var isExpression = function isExpression(node) {
+ return isInstr(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isValtypeLiteral(node) || isIdentifier(node);
+};
+export var isNumericLiteral = function isNumericLiteral(node) {
+ return isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node);
+};
+export var isImportDescr = function isImportDescr(node) {
+ return isGlobalType(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node);
+};
+export var isIntrinsic = function isIntrinsic(node) {
+ return isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node);
+};
+export var assertModule = assertTypeOf("Module");
+export var assertModuleMetadata = assertTypeOf("ModuleMetadata");
+export var assertModuleNameMetadata = assertTypeOf("ModuleNameMetadata");
+export var assertFunctionNameMetadata = assertTypeOf("FunctionNameMetadata");
+export var assertLocalNameMetadata = assertTypeOf("LocalNameMetadata");
+export var assertBinaryModule = assertTypeOf("BinaryModule");
+export var assertQuoteModule = assertTypeOf("QuoteModule");
+export var assertSectionMetadata = assertTypeOf("SectionMetadata");
+export var assertProducersSectionMetadata = assertTypeOf("ProducersSectionMetadata");
+export var assertProducerMetadata = assertTypeOf("ProducerMetadata");
+export var assertProducerMetadataVersionedName = assertTypeOf("ProducerMetadataVersionedName");
+export var assertLoopInstruction = assertTypeOf("LoopInstruction");
+export var assertInstr = assertTypeOf("Instr");
+export var assertIfInstruction = assertTypeOf("IfInstruction");
+export var assertStringLiteral = assertTypeOf("StringLiteral");
+export var assertNumberLiteral = assertTypeOf("NumberLiteral");
+export var assertLongNumberLiteral = assertTypeOf("LongNumberLiteral");
+export var assertFloatLiteral = assertTypeOf("FloatLiteral");
+export var assertElem = assertTypeOf("Elem");
+export var assertIndexInFuncSection = assertTypeOf("IndexInFuncSection");
+export var assertValtypeLiteral = assertTypeOf("ValtypeLiteral");
+export var assertTypeInstruction = assertTypeOf("TypeInstruction");
+export var assertStart = assertTypeOf("Start");
+export var assertGlobalType = assertTypeOf("GlobalType");
+export var assertLeadingComment = assertTypeOf("LeadingComment");
+export var assertBlockComment = assertTypeOf("BlockComment");
+export var assertData = assertTypeOf("Data");
+export var assertGlobal = assertTypeOf("Global");
+export var assertTable = assertTypeOf("Table");
+export var assertMemory = assertTypeOf("Memory");
+export var assertFuncImportDescr = assertTypeOf("FuncImportDescr");
+export var assertModuleImport = assertTypeOf("ModuleImport");
+export var assertModuleExportDescr = assertTypeOf("ModuleExportDescr");
+export var assertModuleExport = assertTypeOf("ModuleExport");
+export var assertLimit = assertTypeOf("Limit");
+export var assertSignature = assertTypeOf("Signature");
+export var assertProgram = assertTypeOf("Program");
+export var assertIdentifier = assertTypeOf("Identifier");
+export var assertBlockInstruction = assertTypeOf("BlockInstruction");
+export var assertCallInstruction = assertTypeOf("CallInstruction");
+export var assertCallIndirectInstruction = assertTypeOf("CallIndirectInstruction");
+export var assertByteArray = assertTypeOf("ByteArray");
+export var assertFunc = assertTypeOf("Func");
+export var assertInternalBrUnless = assertTypeOf("InternalBrUnless");
+export var assertInternalGoto = assertTypeOf("InternalGoto");
+export var assertInternalCallExtern = assertTypeOf("InternalCallExtern");
+export var assertInternalEndAndReturn = assertTypeOf("InternalEndAndReturn");
+export var unionTypesMap = {
+ Module: ["Node"],
+ ModuleMetadata: ["Node"],
+ ModuleNameMetadata: ["Node"],
+ FunctionNameMetadata: ["Node"],
+ LocalNameMetadata: ["Node"],
+ BinaryModule: ["Node"],
+ QuoteModule: ["Node"],
+ SectionMetadata: ["Node"],
+ ProducersSectionMetadata: ["Node"],
+ ProducerMetadata: ["Node"],
+ ProducerMetadataVersionedName: ["Node"],
+ LoopInstruction: ["Node", "Block", "Instruction"],
+ Instr: ["Node", "Expression", "Instruction"],
+ IfInstruction: ["Node", "Instruction"],
+ StringLiteral: ["Node", "Expression"],
+ NumberLiteral: ["Node", "NumericLiteral", "Expression"],
+ LongNumberLiteral: ["Node", "NumericLiteral", "Expression"],
+ FloatLiteral: ["Node", "NumericLiteral", "Expression"],
+ Elem: ["Node"],
+ IndexInFuncSection: ["Node"],
+ ValtypeLiteral: ["Node", "Expression"],
+ TypeInstruction: ["Node", "Instruction"],
+ Start: ["Node"],
+ GlobalType: ["Node", "ImportDescr"],
+ LeadingComment: ["Node"],
+ BlockComment: ["Node"],
+ Data: ["Node"],
+ Global: ["Node"],
+ Table: ["Node", "ImportDescr"],
+ Memory: ["Node", "ImportDescr"],
+ FuncImportDescr: ["Node", "ImportDescr"],
+ ModuleImport: ["Node"],
+ ModuleExportDescr: ["Node"],
+ ModuleExport: ["Node"],
+ Limit: ["Node"],
+ Signature: ["Node"],
+ Program: ["Node"],
+ Identifier: ["Node", "Expression"],
+ BlockInstruction: ["Node", "Block", "Instruction"],
+ CallInstruction: ["Node", "Instruction"],
+ CallIndirectInstruction: ["Node", "Instruction"],
+ ByteArray: ["Node"],
+ Func: ["Node", "Block"],
+ InternalBrUnless: ["Node", "Intrinsic"],
+ InternalGoto: ["Node", "Intrinsic"],
+ InternalCallExtern: ["Node", "Intrinsic"],
+ InternalEndAndReturn: ["Node", "Intrinsic"]
+};
+export var nodeAndUnionTypes = ["Module", "ModuleMetadata", "ModuleNameMetadata", "FunctionNameMetadata", "LocalNameMetadata", "BinaryModule", "QuoteModule", "SectionMetadata", "ProducersSectionMetadata", "ProducerMetadata", "ProducerMetadataVersionedName", "LoopInstruction", "Instr", "IfInstruction", "StringLiteral", "NumberLiteral", "LongNumberLiteral", "FloatLiteral", "Elem", "IndexInFuncSection", "ValtypeLiteral", "TypeInstruction", "Start", "GlobalType", "LeadingComment", "BlockComment", "Data", "Global", "Table", "Memory", "FuncImportDescr", "ModuleImport", "ModuleExportDescr", "ModuleExport", "Limit", "Signature", "Program", "Identifier", "BlockInstruction", "CallInstruction", "CallIndirectInstruction", "ByteArray", "Func", "InternalBrUnless", "InternalGoto", "InternalCallExtern", "InternalEndAndReturn", "Node", "Block", "Instruction", "Expression", "NumericLiteral", "ImportDescr", "Intrinsic"]; \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/esm/signatures.js b/node_modules/@webassemblyjs/ast/esm/signatures.js
new file mode 100644
index 0000000..2f2750b
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/signatures.js
@@ -0,0 +1,199 @@
+function sign(input, output) {
+ return [input, output];
+}
+
+var u32 = "u32";
+var i32 = "i32";
+var i64 = "i64";
+var f32 = "f32";
+var f64 = "f64";
+
+var vector = function vector(t) {
+ var vecType = [t]; // $FlowIgnore
+
+ vecType.vector = true;
+ return vecType;
+};
+
+var controlInstructions = {
+ unreachable: sign([], []),
+ nop: sign([], []),
+ // block ?
+ // loop ?
+ // if ?
+ // if else ?
+ br: sign([u32], []),
+ br_if: sign([u32], []),
+ br_table: sign(vector(u32), []),
+ return: sign([], []),
+ call: sign([u32], []),
+ call_indirect: sign([u32], [])
+};
+var parametricInstructions = {
+ drop: sign([], []),
+ select: sign([], [])
+};
+var variableInstructions = {
+ get_local: sign([u32], []),
+ set_local: sign([u32], []),
+ tee_local: sign([u32], []),
+ get_global: sign([u32], []),
+ set_global: sign([u32], [])
+};
+var memoryInstructions = {
+ "i32.load": sign([u32, u32], [i32]),
+ "i64.load": sign([u32, u32], []),
+ "f32.load": sign([u32, u32], []),
+ "f64.load": sign([u32, u32], []),
+ "i32.load8_s": sign([u32, u32], [i32]),
+ "i32.load8_u": sign([u32, u32], [i32]),
+ "i32.load16_s": sign([u32, u32], [i32]),
+ "i32.load16_u": sign([u32, u32], [i32]),
+ "i64.load8_s": sign([u32, u32], [i64]),
+ "i64.load8_u": sign([u32, u32], [i64]),
+ "i64.load16_s": sign([u32, u32], [i64]),
+ "i64.load16_u": sign([u32, u32], [i64]),
+ "i64.load32_s": sign([u32, u32], [i64]),
+ "i64.load32_u": sign([u32, u32], [i64]),
+ "i32.store": sign([u32, u32], []),
+ "i64.store": sign([u32, u32], []),
+ "f32.store": sign([u32, u32], []),
+ "f64.store": sign([u32, u32], []),
+ "i32.store8": sign([u32, u32], []),
+ "i32.store16": sign([u32, u32], []),
+ "i64.store8": sign([u32, u32], []),
+ "i64.store16": sign([u32, u32], []),
+ "i64.store32": sign([u32, u32], []),
+ current_memory: sign([], []),
+ grow_memory: sign([], [])
+};
+var numericInstructions = {
+ "i32.const": sign([i32], [i32]),
+ "i64.const": sign([i64], [i64]),
+ "f32.const": sign([f32], [f32]),
+ "f64.const": sign([f64], [f64]),
+ "i32.eqz": sign([i32], [i32]),
+ "i32.eq": sign([i32, i32], [i32]),
+ "i32.ne": sign([i32, i32], [i32]),
+ "i32.lt_s": sign([i32, i32], [i32]),
+ "i32.lt_u": sign([i32, i32], [i32]),
+ "i32.gt_s": sign([i32, i32], [i32]),
+ "i32.gt_u": sign([i32, i32], [i32]),
+ "i32.le_s": sign([i32, i32], [i32]),
+ "i32.le_u": sign([i32, i32], [i32]),
+ "i32.ge_s": sign([i32, i32], [i32]),
+ "i32.ge_u": sign([i32, i32], [i32]),
+ "i64.eqz": sign([i64], [i64]),
+ "i64.eq": sign([i64, i64], [i32]),
+ "i64.ne": sign([i64, i64], [i32]),
+ "i64.lt_s": sign([i64, i64], [i32]),
+ "i64.lt_u": sign([i64, i64], [i32]),
+ "i64.gt_s": sign([i64, i64], [i32]),
+ "i64.gt_u": sign([i64, i64], [i32]),
+ "i64.le_s": sign([i64, i64], [i32]),
+ "i64.le_u": sign([i64, i64], [i32]),
+ "i64.ge_s": sign([i64, i64], [i32]),
+ "i64.ge_u": sign([i64, i64], [i32]),
+ "f32.eq": sign([f32, f32], [i32]),
+ "f32.ne": sign([f32, f32], [i32]),
+ "f32.lt": sign([f32, f32], [i32]),
+ "f32.gt": sign([f32, f32], [i32]),
+ "f32.le": sign([f32, f32], [i32]),
+ "f32.ge": sign([f32, f32], [i32]),
+ "f64.eq": sign([f64, f64], [i32]),
+ "f64.ne": sign([f64, f64], [i32]),
+ "f64.lt": sign([f64, f64], [i32]),
+ "f64.gt": sign([f64, f64], [i32]),
+ "f64.le": sign([f64, f64], [i32]),
+ "f64.ge": sign([f64, f64], [i32]),
+ "i32.clz": sign([i32], [i32]),
+ "i32.ctz": sign([i32], [i32]),
+ "i32.popcnt": sign([i32], [i32]),
+ "i32.add": sign([i32, i32], [i32]),
+ "i32.sub": sign([i32, i32], [i32]),
+ "i32.mul": sign([i32, i32], [i32]),
+ "i32.div_s": sign([i32, i32], [i32]),
+ "i32.div_u": sign([i32, i32], [i32]),
+ "i32.rem_s": sign([i32, i32], [i32]),
+ "i32.rem_u": sign([i32, i32], [i32]),
+ "i32.and": sign([i32, i32], [i32]),
+ "i32.or": sign([i32, i32], [i32]),
+ "i32.xor": sign([i32, i32], [i32]),
+ "i32.shl": sign([i32, i32], [i32]),
+ "i32.shr_s": sign([i32, i32], [i32]),
+ "i32.shr_u": sign([i32, i32], [i32]),
+ "i32.rotl": sign([i32, i32], [i32]),
+ "i32.rotr": sign([i32, i32], [i32]),
+ "i64.clz": sign([i64], [i64]),
+ "i64.ctz": sign([i64], [i64]),
+ "i64.popcnt": sign([i64], [i64]),
+ "i64.add": sign([i64, i64], [i64]),
+ "i64.sub": sign([i64, i64], [i64]),
+ "i64.mul": sign([i64, i64], [i64]),
+ "i64.div_s": sign([i64, i64], [i64]),
+ "i64.div_u": sign([i64, i64], [i64]),
+ "i64.rem_s": sign([i64, i64], [i64]),
+ "i64.rem_u": sign([i64, i64], [i64]),
+ "i64.and": sign([i64, i64], [i64]),
+ "i64.or": sign([i64, i64], [i64]),
+ "i64.xor": sign([i64, i64], [i64]),
+ "i64.shl": sign([i64, i64], [i64]),
+ "i64.shr_s": sign([i64, i64], [i64]),
+ "i64.shr_u": sign([i64, i64], [i64]),
+ "i64.rotl": sign([i64, i64], [i64]),
+ "i64.rotr": sign([i64, i64], [i64]),
+ "f32.abs": sign([f32], [f32]),
+ "f32.neg": sign([f32], [f32]),
+ "f32.ceil": sign([f32], [f32]),
+ "f32.floor": sign([f32], [f32]),
+ "f32.trunc": sign([f32], [f32]),
+ "f32.nearest": sign([f32], [f32]),
+ "f32.sqrt": sign([f32], [f32]),
+ "f32.add": sign([f32, f32], [f32]),
+ "f32.sub": sign([f32, f32], [f32]),
+ "f32.mul": sign([f32, f32], [f32]),
+ "f32.div": sign([f32, f32], [f32]),
+ "f32.min": sign([f32, f32], [f32]),
+ "f32.max": sign([f32, f32], [f32]),
+ "f32.copysign": sign([f32, f32], [f32]),
+ "f64.abs": sign([f64], [f64]),
+ "f64.neg": sign([f64], [f64]),
+ "f64.ceil": sign([f64], [f64]),
+ "f64.floor": sign([f64], [f64]),
+ "f64.trunc": sign([f64], [f64]),
+ "f64.nearest": sign([f64], [f64]),
+ "f64.sqrt": sign([f64], [f64]),
+ "f64.add": sign([f64, f64], [f64]),
+ "f64.sub": sign([f64, f64], [f64]),
+ "f64.mul": sign([f64, f64], [f64]),
+ "f64.div": sign([f64, f64], [f64]),
+ "f64.min": sign([f64, f64], [f64]),
+ "f64.max": sign([f64, f64], [f64]),
+ "f64.copysign": sign([f64, f64], [f64]),
+ "i32.wrap/i64": sign([i64], [i32]),
+ "i32.trunc_s/f32": sign([f32], [i32]),
+ "i32.trunc_u/f32": sign([f32], [i32]),
+ "i32.trunc_s/f64": sign([f32], [i32]),
+ "i32.trunc_u/f64": sign([f64], [i32]),
+ "i64.extend_s/i32": sign([i32], [i64]),
+ "i64.extend_u/i32": sign([i32], [i64]),
+ "i64.trunc_s/f32": sign([f32], [i64]),
+ "i64.trunc_u/f32": sign([f32], [i64]),
+ "i64.trunc_s/f64": sign([f64], [i64]),
+ "i64.trunc_u/f64": sign([f64], [i64]),
+ "f32.convert_s/i32": sign([i32], [f32]),
+ "f32.convert_u/i32": sign([i32], [f32]),
+ "f32.convert_s/i64": sign([i64], [f32]),
+ "f32.convert_u/i64": sign([i64], [f32]),
+ "f32.demote/f64": sign([f64], [f32]),
+ "f64.convert_s/i32": sign([i32], [f64]),
+ "f64.convert_u/i32": sign([i32], [f64]),
+ "f64.convert_s/i64": sign([i64], [f64]),
+ "f64.convert_u/i64": sign([i64], [f64]),
+ "f64.promote/f32": sign([f32], [f64]),
+ "i32.reinterpret/f32": sign([f32], [i32]),
+ "i64.reinterpret/f64": sign([f64], [i64]),
+ "f32.reinterpret/i32": sign([i32], [f32]),
+ "f64.reinterpret/i64": sign([i64], [f64])
+};
+export var signatures = Object.assign({}, controlInstructions, parametricInstructions, variableInstructions, memoryInstructions, numericInstructions); \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/esm/transform/denormalize-type-references/index.js b/node_modules/@webassemblyjs/ast/esm/transform/denormalize-type-references/index.js
new file mode 100644
index 0000000..26891f9
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/transform/denormalize-type-references/index.js
@@ -0,0 +1,76 @@
+var t = require("../../index"); // func and call_indirect instructions can either define a signature inline, or
+// reference a signature, e.g.
+//
+// ;; inline signature
+// (func (result i64)
+// (i64.const 2)
+// )
+// ;; signature reference
+// (type (func (result i64)))
+// (func (type 0)
+// (i64.const 2))
+// )
+//
+// this AST transform denormalises the type references, making all signatures within the module
+// inline.
+
+
+export function transform(ast) {
+ var typeInstructions = [];
+ t.traverse(ast, {
+ TypeInstruction: function TypeInstruction(_ref) {
+ var node = _ref.node;
+ typeInstructions.push(node);
+ }
+ });
+
+ if (!typeInstructions.length) {
+ return;
+ }
+
+ function denormalizeSignature(signature) {
+ // signature referenced by identifier
+ if (signature.type === "Identifier") {
+ var identifier = signature;
+ var typeInstruction = typeInstructions.find(function (t) {
+ return t.id.type === identifier.type && t.id.value === identifier.value;
+ });
+
+ if (!typeInstruction) {
+ throw new Error("A type instruction reference was not found ".concat(JSON.stringify(signature)));
+ }
+
+ return typeInstruction.functype;
+ } // signature referenced by index
+
+
+ if (signature.type === "NumberLiteral") {
+ var signatureRef = signature;
+ var _typeInstruction = typeInstructions[signatureRef.value];
+ return _typeInstruction.functype;
+ }
+
+ return signature;
+ }
+
+ t.traverse(ast, {
+ Func: function (_Func) {
+ function Func(_x) {
+ return _Func.apply(this, arguments);
+ }
+
+ Func.toString = function () {
+ return _Func.toString();
+ };
+
+ return Func;
+ }(function (_ref2) {
+ var node = _ref2.node;
+ node.signature = denormalizeSignature(node.signature);
+ }),
+ CallIndirectInstruction: function CallIndirectInstruction(_ref3) {
+ var node = _ref3.node;
+ node.signature = denormalizeSignature(node.signature);
+ }
+ });
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/esm/transform/wast-identifier-to-index/index.js b/node_modules/@webassemblyjs/ast/esm/transform/wast-identifier-to-index/index.js
new file mode 100644
index 0000000..bea35f3
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/transform/wast-identifier-to-index/index.js
@@ -0,0 +1,216 @@
+function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
+function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
+
+function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }
+
+import { isBlock, isFunc, isIdentifier, numberLiteralFromRaw, traverse } from "../../index";
+import { moduleContextFromModuleAST } from "@webassemblyjs/helper-module-context"; // FIXME(sven): do the same with all block instructions, must be more generic here
+
+function newUnexpectedFunction(i) {
+ return new Error("unknown function at offset: " + i);
+}
+
+export function transform(ast) {
+ var module;
+ traverse(ast, {
+ Module: function (_Module) {
+ function Module(_x) {
+ return _Module.apply(this, arguments);
+ }
+
+ Module.toString = function () {
+ return _Module.toString();
+ };
+
+ return Module;
+ }(function (path) {
+ module = path.node;
+ })
+ });
+ var moduleContext = moduleContextFromModuleAST(module); // Transform the actual instruction in function bodies
+
+ traverse(ast, {
+ Func: function (_Func) {
+ function Func(_x2) {
+ return _Func.apply(this, arguments);
+ }
+
+ Func.toString = function () {
+ return _Func.toString();
+ };
+
+ return Func;
+ }(function (path) {
+ transformFuncPath(path, moduleContext);
+ }),
+ Start: function (_Start) {
+ function Start(_x3) {
+ return _Start.apply(this, arguments);
+ }
+
+ Start.toString = function () {
+ return _Start.toString();
+ };
+
+ return Start;
+ }(function (path) {
+ var index = path.node.index;
+
+ if (isIdentifier(index) === true) {
+ var offsetInModule = moduleContext.getFunctionOffsetByIdentifier(index.value);
+
+ if (typeof offsetInModule === "undefined") {
+ throw newUnexpectedFunction(index.value);
+ } // Replace the index Identifier
+ // $FlowIgnore: reference?
+
+
+ path.node.index = numberLiteralFromRaw(offsetInModule);
+ }
+ })
+ });
+}
+
+function transformFuncPath(funcPath, moduleContext) {
+ var funcNode = funcPath.node;
+ var signature = funcNode.signature;
+
+ if (signature.type !== "Signature") {
+ throw new Error("Function signatures must be denormalised before execution");
+ }
+
+ var params = signature.params; // Add func locals in the context
+
+ params.forEach(function (p) {
+ return moduleContext.addLocal(p.valtype);
+ });
+ traverse(funcNode, {
+ Instr: function (_Instr) {
+ function Instr(_x4) {
+ return _Instr.apply(this, arguments);
+ }
+
+ Instr.toString = function () {
+ return _Instr.toString();
+ };
+
+ return Instr;
+ }(function (instrPath) {
+ var instrNode = instrPath.node;
+ /**
+ * Local access
+ */
+
+ if (instrNode.id === "get_local" || instrNode.id === "set_local" || instrNode.id === "tee_local") {
+ var _instrNode$args = _slicedToArray(instrNode.args, 1),
+ firstArg = _instrNode$args[0];
+
+ if (firstArg.type === "Identifier") {
+ var offsetInParams = params.findIndex(function (_ref) {
+ var id = _ref.id;
+ return id === firstArg.value;
+ });
+
+ if (offsetInParams === -1) {
+ throw new Error("".concat(firstArg.value, " not found in ").concat(instrNode.id, ": not declared in func params"));
+ } // Replace the Identifer node by our new NumberLiteral node
+
+
+ instrNode.args[0] = numberLiteralFromRaw(offsetInParams);
+ }
+ }
+ /**
+ * Global access
+ */
+
+
+ if (instrNode.id === "get_global" || instrNode.id === "set_global") {
+ var _instrNode$args2 = _slicedToArray(instrNode.args, 1),
+ _firstArg = _instrNode$args2[0];
+
+ if (isIdentifier(_firstArg) === true) {
+ var globalOffset = moduleContext.getGlobalOffsetByIdentifier( // $FlowIgnore: reference?
+ _firstArg.value);
+
+ if (typeof globalOffset === "undefined") {
+ // $FlowIgnore: reference?
+ throw new Error("global ".concat(_firstArg.value, " not found in module"));
+ } // Replace the Identifer node by our new NumberLiteral node
+
+
+ instrNode.args[0] = numberLiteralFromRaw(globalOffset);
+ }
+ }
+ /**
+ * Labels lookup
+ */
+
+
+ if (instrNode.id === "br") {
+ var _instrNode$args3 = _slicedToArray(instrNode.args, 1),
+ _firstArg2 = _instrNode$args3[0];
+
+ if (isIdentifier(_firstArg2) === true) {
+ // if the labels is not found it is going to be replaced with -1
+ // which is invalid.
+ var relativeBlockCount = -1; // $FlowIgnore: reference?
+
+ instrPath.findParent(function (_ref2) {
+ var node = _ref2.node;
+
+ if (isBlock(node)) {
+ relativeBlockCount++; // $FlowIgnore: reference?
+
+ var name = node.label || node.name;
+
+ if (_typeof(name) === "object") {
+ // $FlowIgnore: isIdentifier ensures that
+ if (name.value === _firstArg2.value) {
+ // Found it
+ return false;
+ }
+ }
+ }
+
+ if (isFunc(node)) {
+ return false;
+ }
+ }); // Replace the Identifer node by our new NumberLiteral node
+
+ instrNode.args[0] = numberLiteralFromRaw(relativeBlockCount);
+ }
+ }
+ }),
+
+ /**
+ * Func lookup
+ */
+ CallInstruction: function (_CallInstruction) {
+ function CallInstruction(_x5) {
+ return _CallInstruction.apply(this, arguments);
+ }
+
+ CallInstruction.toString = function () {
+ return _CallInstruction.toString();
+ };
+
+ return CallInstruction;
+ }(function (_ref3) {
+ var node = _ref3.node;
+ var index = node.index;
+
+ if (isIdentifier(index) === true) {
+ var offsetInModule = moduleContext.getFunctionOffsetByIdentifier(index.value);
+
+ if (typeof offsetInModule === "undefined") {
+ throw newUnexpectedFunction(index.value);
+ } // Replace the index Identifier
+ // $FlowIgnore: reference?
+
+
+ node.index = numberLiteralFromRaw(offsetInModule);
+ }
+ })
+ });
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/esm/traverse.js b/node_modules/@webassemblyjs/ast/esm/traverse.js
new file mode 100644
index 0000000..328dc09
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/traverse.js
@@ -0,0 +1,96 @@
+import { createPath } from "./node-path";
+import { unionTypesMap, nodeAndUnionTypes } from "./nodes"; // recursively walks the AST starting at the given node. The callback is invoked for
+// and object that has a 'type' property.
+
+function walk(context, callback) {
+ var stop = false;
+
+ function innerWalk(context, callback) {
+ if (stop) {
+ return;
+ }
+
+ var node = context.node;
+
+ if (node === undefined) {
+ console.warn("traversing with an empty context");
+ return;
+ }
+
+ if (node._deleted === true) {
+ return;
+ }
+
+ var path = createPath(context);
+ callback(node.type, path);
+
+ if (path.shouldStop) {
+ stop = true;
+ return;
+ }
+
+ Object.keys(node).forEach(function (prop) {
+ var value = node[prop];
+
+ if (value === null || value === undefined) {
+ return;
+ }
+
+ var valueAsArray = Array.isArray(value) ? value : [value];
+ valueAsArray.forEach(function (childNode) {
+ if (typeof childNode.type === "string") {
+ var childContext = {
+ node: childNode,
+ parentKey: prop,
+ parentPath: path,
+ shouldStop: false,
+ inList: Array.isArray(value)
+ };
+ innerWalk(childContext, callback);
+ }
+ });
+ });
+ }
+
+ innerWalk(context, callback);
+}
+
+var noop = function noop() {};
+
+export function traverse(node, visitors) {
+ var before = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
+ var after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : noop;
+ Object.keys(visitors).forEach(function (visitor) {
+ if (!nodeAndUnionTypes.includes(visitor)) {
+ throw new Error("Unexpected visitor ".concat(visitor));
+ }
+ });
+ var context = {
+ node: node,
+ inList: false,
+ shouldStop: false,
+ parentPath: null,
+ parentKey: null
+ };
+ walk(context, function (type, path) {
+ if (typeof visitors[type] === "function") {
+ before(type, path);
+ visitors[type](path);
+ after(type, path);
+ }
+
+ var unionTypes = unionTypesMap[type];
+
+ if (!unionTypes) {
+ throw new Error("Unexpected node type ".concat(type));
+ }
+
+ unionTypes.forEach(function (unionType) {
+ if (typeof visitors[unionType] === "function") {
+ before(unionType, path);
+ visitors[unionType](path);
+ after(unionType, path);
+ }
+ });
+ });
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/esm/types/basic.js b/node_modules/@webassemblyjs/ast/esm/types/basic.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/types/basic.js
diff --git a/node_modules/@webassemblyjs/ast/esm/types/nodes.js b/node_modules/@webassemblyjs/ast/esm/types/nodes.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/types/nodes.js
diff --git a/node_modules/@webassemblyjs/ast/esm/types/traverse.js b/node_modules/@webassemblyjs/ast/esm/types/traverse.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/types/traverse.js
diff --git a/node_modules/@webassemblyjs/ast/esm/utils.js b/node_modules/@webassemblyjs/ast/esm/utils.js
new file mode 100644
index 0000000..850410e
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/esm/utils.js
@@ -0,0 +1,265 @@
+function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
+
+function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }
+
+function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
+import { signatures } from "./signatures";
+import { traverse } from "./traverse";
+import constants from "@webassemblyjs/helper-wasm-bytecode";
+import { getSectionForNode } from "@webassemblyjs/helper-wasm-bytecode";
+export function isAnonymous(ident) {
+ return ident.raw === "";
+}
+export function getSectionMetadata(ast, name) {
+ var section;
+ traverse(ast, {
+ SectionMetadata: function (_SectionMetadata) {
+ function SectionMetadata(_x) {
+ return _SectionMetadata.apply(this, arguments);
+ }
+
+ SectionMetadata.toString = function () {
+ return _SectionMetadata.toString();
+ };
+
+ return SectionMetadata;
+ }(function (_ref) {
+ var node = _ref.node;
+
+ if (node.section === name) {
+ section = node;
+ }
+ })
+ });
+ return section;
+}
+export function getSectionMetadatas(ast, name) {
+ var sections = [];
+ traverse(ast, {
+ SectionMetadata: function (_SectionMetadata2) {
+ function SectionMetadata(_x2) {
+ return _SectionMetadata2.apply(this, arguments);
+ }
+
+ SectionMetadata.toString = function () {
+ return _SectionMetadata2.toString();
+ };
+
+ return SectionMetadata;
+ }(function (_ref2) {
+ var node = _ref2.node;
+
+ if (node.section === name) {
+ sections.push(node);
+ }
+ })
+ });
+ return sections;
+}
+export function sortSectionMetadata(m) {
+ if (m.metadata == null) {
+ console.warn("sortSectionMetadata: no metadata to sort");
+ return;
+ } // $FlowIgnore
+
+
+ m.metadata.sections.sort(function (a, b) {
+ var aId = constants.sections[a.section];
+ var bId = constants.sections[b.section];
+
+ if (typeof aId !== "number" || typeof bId !== "number") {
+ throw new Error("Section id not found");
+ }
+
+ return aId - bId;
+ });
+}
+export function orderedInsertNode(m, n) {
+ assertHasLoc(n);
+ var didInsert = false;
+
+ if (n.type === "ModuleExport") {
+ m.fields.push(n);
+ return;
+ }
+
+ m.fields = m.fields.reduce(function (acc, field) {
+ var fieldEndCol = Infinity;
+
+ if (field.loc != null) {
+ // $FlowIgnore
+ fieldEndCol = field.loc.end.column;
+ } // $FlowIgnore: assertHasLoc ensures that
+
+
+ if (didInsert === false && n.loc.start.column < fieldEndCol) {
+ didInsert = true;
+ acc.push(n);
+ }
+
+ acc.push(field);
+ return acc;
+ }, []); // Handles empty modules or n is the last element
+
+ if (didInsert === false) {
+ m.fields.push(n);
+ }
+}
+export function assertHasLoc(n) {
+ if (n.loc == null || n.loc.start == null || n.loc.end == null) {
+ throw new Error("Internal failure: node (".concat(JSON.stringify(n.type), ") has no location information"));
+ }
+}
+export function getEndOfSection(s) {
+ assertHasLoc(s.size);
+ return s.startOffset + s.size.value + ( // $FlowIgnore
+ s.size.loc.end.column - s.size.loc.start.column);
+}
+export function shiftLoc(node, delta) {
+ // $FlowIgnore
+ node.loc.start.column += delta; // $FlowIgnore
+
+ node.loc.end.column += delta;
+}
+export function shiftSection(ast, node, delta) {
+ if (node.type !== "SectionMetadata") {
+ throw new Error("Can not shift node " + JSON.stringify(node.type));
+ }
+
+ node.startOffset += delta;
+
+ if (_typeof(node.size.loc) === "object") {
+ shiftLoc(node.size, delta);
+ } // Custom sections doesn't have vectorOfSize
+
+
+ if (_typeof(node.vectorOfSize) === "object" && _typeof(node.vectorOfSize.loc) === "object") {
+ shiftLoc(node.vectorOfSize, delta);
+ }
+
+ var sectionName = node.section; // shift node locations within that section
+
+ traverse(ast, {
+ Node: function Node(_ref3) {
+ var node = _ref3.node;
+ var section = getSectionForNode(node);
+
+ if (section === sectionName && _typeof(node.loc) === "object") {
+ shiftLoc(node, delta);
+ }
+ }
+ });
+}
+export function signatureForOpcode(object, name) {
+ var opcodeName = name;
+
+ if (object !== undefined && object !== "") {
+ opcodeName = object + "." + name;
+ }
+
+ var sign = signatures[opcodeName];
+
+ if (sign == undefined) {
+ // TODO: Uncomment this when br_table and others has been done
+ //throw new Error("Invalid opcode: "+opcodeName);
+ return [object, object];
+ }
+
+ return sign[0];
+}
+export function getUniqueNameGenerator() {
+ var inc = {};
+ return function () {
+ var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp";
+
+ if (!(prefix in inc)) {
+ inc[prefix] = 0;
+ } else {
+ inc[prefix] = inc[prefix] + 1;
+ }
+
+ return prefix + "_" + inc[prefix];
+ };
+}
+export function getStartByteOffset(n) {
+ // $FlowIgnore
+ if (typeof n.loc === "undefined" || typeof n.loc.start === "undefined") {
+ throw new Error( // $FlowIgnore
+ "Can not get byte offset without loc informations, node: " + String(n.id));
+ }
+
+ return n.loc.start.column;
+}
+export function getEndByteOffset(n) {
+ // $FlowIgnore
+ if (typeof n.loc === "undefined" || typeof n.loc.end === "undefined") {
+ throw new Error("Can not get byte offset without loc informations, node: " + n.type);
+ }
+
+ return n.loc.end.column;
+}
+export function getFunctionBeginingByteOffset(n) {
+ if (!(n.body.length > 0)) {
+ throw new Error('n.body.length > 0' + " error: " + (undefined || "unknown"));
+ }
+
+ var _n$body = _slicedToArray(n.body, 1),
+ firstInstruction = _n$body[0];
+
+ return getStartByteOffset(firstInstruction);
+}
+export function getEndBlockByteOffset(n) {
+ // $FlowIgnore
+ if (!(n.instr.length > 0 || n.body.length > 0)) {
+ throw new Error('n.instr.length > 0 || n.body.length > 0' + " error: " + (undefined || "unknown"));
+ }
+
+ var lastInstruction;
+
+ if (n.instr) {
+ // $FlowIgnore
+ lastInstruction = n.instr[n.instr.length - 1];
+ }
+
+ if (n.body) {
+ // $FlowIgnore
+ lastInstruction = n.body[n.body.length - 1];
+ }
+
+ if (!(_typeof(lastInstruction) === "object")) {
+ throw new Error('typeof lastInstruction === "object"' + " error: " + (undefined || "unknown"));
+ }
+
+ // $FlowIgnore
+ return getStartByteOffset(lastInstruction);
+}
+export function getStartBlockByteOffset(n) {
+ // $FlowIgnore
+ if (!(n.instr.length > 0 || n.body.length > 0)) {
+ throw new Error('n.instr.length > 0 || n.body.length > 0' + " error: " + (undefined || "unknown"));
+ }
+
+ var fistInstruction;
+
+ if (n.instr) {
+ // $FlowIgnore
+ var _n$instr = _slicedToArray(n.instr, 1);
+
+ fistInstruction = _n$instr[0];
+ }
+
+ if (n.body) {
+ // $FlowIgnore
+ var _n$body2 = _slicedToArray(n.body, 1);
+
+ fistInstruction = _n$body2[0];
+ }
+
+ if (!(_typeof(fistInstruction) === "object")) {
+ throw new Error('typeof fistInstruction === "object"' + " error: " + (undefined || "unknown"));
+ }
+
+ // $FlowIgnore
+ return getStartByteOffset(fistInstruction);
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/lib/clone.js b/node_modules/@webassemblyjs/ast/lib/clone.js
new file mode 100644
index 0000000..7c386a4
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/clone.js
@@ -0,0 +1,17 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.cloneNode = cloneNode;
+
+function cloneNode(n) {
+ // $FlowIgnore
+ var newObj = {};
+
+ for (var k in n) {
+ newObj[k] = n[k];
+ }
+
+ return newObj;
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/lib/definitions.js b/node_modules/@webassemblyjs/ast/lib/definitions.js
new file mode 100644
index 0000000..120311b
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/definitions.js
@@ -0,0 +1,663 @@
+var definitions = {};
+
+function defineType(typeName, metadata) {
+ definitions[typeName] = metadata;
+}
+
+defineType("Module", {
+ spec: {
+ wasm: "https://webassembly.github.io/spec/core/binary/modules.html#binary-module",
+ wat: "https://webassembly.github.io/spec/core/text/modules.html#text-module"
+ },
+ doc: "A module consists of a sequence of sections (termed fields in the text format).",
+ unionType: ["Node"],
+ fields: {
+ id: {
+ maybe: true,
+ type: "string"
+ },
+ fields: {
+ array: true,
+ type: "Node"
+ },
+ metadata: {
+ optional: true,
+ type: "ModuleMetadata"
+ }
+ }
+});
+defineType("ModuleMetadata", {
+ unionType: ["Node"],
+ fields: {
+ sections: {
+ array: true,
+ type: "SectionMetadata"
+ },
+ functionNames: {
+ optional: true,
+ array: true,
+ type: "FunctionNameMetadata"
+ },
+ localNames: {
+ optional: true,
+ array: true,
+ type: "ModuleMetadata"
+ },
+ producers: {
+ optional: true,
+ array: true,
+ type: "ProducersSectionMetadata"
+ }
+ }
+});
+defineType("ModuleNameMetadata", {
+ unionType: ["Node"],
+ fields: {
+ value: {
+ type: "string"
+ }
+ }
+});
+defineType("FunctionNameMetadata", {
+ unionType: ["Node"],
+ fields: {
+ value: {
+ type: "string"
+ },
+ index: {
+ type: "number"
+ }
+ }
+});
+defineType("LocalNameMetadata", {
+ unionType: ["Node"],
+ fields: {
+ value: {
+ type: "string"
+ },
+ localIndex: {
+ type: "number"
+ },
+ functionIndex: {
+ type: "number"
+ }
+ }
+});
+defineType("BinaryModule", {
+ unionType: ["Node"],
+ fields: {
+ id: {
+ maybe: true,
+ type: "string"
+ },
+ blob: {
+ array: true,
+ type: "string"
+ }
+ }
+});
+defineType("QuoteModule", {
+ unionType: ["Node"],
+ fields: {
+ id: {
+ maybe: true,
+ type: "string"
+ },
+ string: {
+ array: true,
+ type: "string"
+ }
+ }
+});
+defineType("SectionMetadata", {
+ unionType: ["Node"],
+ fields: {
+ section: {
+ type: "SectionName"
+ },
+ startOffset: {
+ type: "number"
+ },
+ size: {
+ type: "NumberLiteral"
+ },
+ vectorOfSize: {
+ comment: "Size of the vector in the section (if any)",
+ type: "NumberLiteral"
+ }
+ }
+});
+defineType("ProducersSectionMetadata", {
+ unionType: ["Node"],
+ fields: {
+ producers: {
+ array: true,
+ type: "ProducerMetadata"
+ }
+ }
+});
+defineType("ProducerMetadata", {
+ unionType: ["Node"],
+ fields: {
+ language: {
+ type: "ProducerMetadataVersionedName",
+ array: true
+ },
+ processedBy: {
+ type: "ProducerMetadataVersionedName",
+ array: true
+ },
+ sdk: {
+ type: "ProducerMetadataVersionedName",
+ array: true
+ }
+ }
+});
+defineType("ProducerMetadataVersionedName", {
+ unionType: ["Node"],
+ fields: {
+ name: {
+ type: "string"
+ },
+ version: {
+ type: "string"
+ }
+ }
+});
+/*
+Instructions
+*/
+
+defineType("LoopInstruction", {
+ unionType: ["Node", "Block", "Instruction"],
+ fields: {
+ id: {
+ constant: true,
+ type: "string",
+ value: "loop"
+ },
+ label: {
+ maybe: true,
+ type: "Identifier"
+ },
+ resulttype: {
+ maybe: true,
+ type: "Valtype"
+ },
+ instr: {
+ array: true,
+ type: "Instruction"
+ }
+ }
+});
+defineType("Instr", {
+ unionType: ["Node", "Expression", "Instruction"],
+ fields: {
+ id: {
+ type: "string"
+ },
+ object: {
+ optional: true,
+ type: "Valtype"
+ },
+ args: {
+ array: true,
+ type: "Expression"
+ },
+ namedArgs: {
+ optional: true,
+ type: "Object"
+ }
+ }
+});
+defineType("IfInstruction", {
+ unionType: ["Node", "Instruction"],
+ fields: {
+ id: {
+ constant: true,
+ type: "string",
+ value: "if"
+ },
+ testLabel: {
+ comment: "only for WAST",
+ type: "Identifier"
+ },
+ test: {
+ array: true,
+ type: "Instruction"
+ },
+ result: {
+ maybe: true,
+ type: "Valtype"
+ },
+ consequent: {
+ array: true,
+ type: "Instruction"
+ },
+ alternate: {
+ array: true,
+ type: "Instruction"
+ }
+ }
+});
+/*
+Concrete value types
+*/
+
+defineType("StringLiteral", {
+ unionType: ["Node", "Expression"],
+ fields: {
+ value: {
+ type: "string"
+ }
+ }
+});
+defineType("NumberLiteral", {
+ unionType: ["Node", "NumericLiteral", "Expression"],
+ fields: {
+ value: {
+ type: "number"
+ },
+ raw: {
+ type: "string"
+ }
+ }
+});
+defineType("LongNumberLiteral", {
+ unionType: ["Node", "NumericLiteral", "Expression"],
+ fields: {
+ value: {
+ type: "LongNumber"
+ },
+ raw: {
+ type: "string"
+ }
+ }
+});
+defineType("FloatLiteral", {
+ unionType: ["Node", "NumericLiteral", "Expression"],
+ fields: {
+ value: {
+ type: "number"
+ },
+ nan: {
+ optional: true,
+ type: "boolean"
+ },
+ inf: {
+ optional: true,
+ type: "boolean"
+ },
+ raw: {
+ type: "string"
+ }
+ }
+});
+defineType("Elem", {
+ unionType: ["Node"],
+ fields: {
+ table: {
+ type: "Index"
+ },
+ offset: {
+ array: true,
+ type: "Instruction"
+ },
+ funcs: {
+ array: true,
+ type: "Index"
+ }
+ }
+});
+defineType("IndexInFuncSection", {
+ unionType: ["Node"],
+ fields: {
+ index: {
+ type: "Index"
+ }
+ }
+});
+defineType("ValtypeLiteral", {
+ unionType: ["Node", "Expression"],
+ fields: {
+ name: {
+ type: "Valtype"
+ }
+ }
+});
+defineType("TypeInstruction", {
+ unionType: ["Node", "Instruction"],
+ fields: {
+ id: {
+ maybe: true,
+ type: "Index"
+ },
+ functype: {
+ type: "Signature"
+ }
+ }
+});
+defineType("Start", {
+ unionType: ["Node"],
+ fields: {
+ index: {
+ type: "Index"
+ }
+ }
+});
+defineType("GlobalType", {
+ unionType: ["Node", "ImportDescr"],
+ fields: {
+ valtype: {
+ type: "Valtype"
+ },
+ mutability: {
+ type: "Mutability"
+ }
+ }
+});
+defineType("LeadingComment", {
+ unionType: ["Node"],
+ fields: {
+ value: {
+ type: "string"
+ }
+ }
+});
+defineType("BlockComment", {
+ unionType: ["Node"],
+ fields: {
+ value: {
+ type: "string"
+ }
+ }
+});
+defineType("Data", {
+ unionType: ["Node"],
+ fields: {
+ memoryIndex: {
+ type: "Memidx"
+ },
+ offset: {
+ type: "Instruction"
+ },
+ init: {
+ type: "ByteArray"
+ }
+ }
+});
+defineType("Global", {
+ unionType: ["Node"],
+ fields: {
+ globalType: {
+ type: "GlobalType"
+ },
+ init: {
+ array: true,
+ type: "Instruction"
+ },
+ name: {
+ maybe: true,
+ type: "Identifier"
+ }
+ }
+});
+defineType("Table", {
+ unionType: ["Node", "ImportDescr"],
+ fields: {
+ elementType: {
+ type: "TableElementType"
+ },
+ limits: {
+ assertNodeType: true,
+ type: "Limit"
+ },
+ name: {
+ maybe: true,
+ type: "Identifier"
+ },
+ elements: {
+ array: true,
+ optional: true,
+ type: "Index"
+ }
+ }
+});
+defineType("Memory", {
+ unionType: ["Node", "ImportDescr"],
+ fields: {
+ limits: {
+ type: "Limit"
+ },
+ id: {
+ maybe: true,
+ type: "Index"
+ }
+ }
+});
+defineType("FuncImportDescr", {
+ unionType: ["Node", "ImportDescr"],
+ fields: {
+ id: {
+ type: "Identifier"
+ },
+ signature: {
+ type: "Signature"
+ }
+ }
+});
+defineType("ModuleImport", {
+ unionType: ["Node"],
+ fields: {
+ module: {
+ type: "string"
+ },
+ name: {
+ type: "string"
+ },
+ descr: {
+ type: "ImportDescr"
+ }
+ }
+});
+defineType("ModuleExportDescr", {
+ unionType: ["Node"],
+ fields: {
+ exportType: {
+ type: "ExportDescrType"
+ },
+ id: {
+ type: "Index"
+ }
+ }
+});
+defineType("ModuleExport", {
+ unionType: ["Node"],
+ fields: {
+ name: {
+ type: "string"
+ },
+ descr: {
+ type: "ModuleExportDescr"
+ }
+ }
+});
+defineType("Limit", {
+ unionType: ["Node"],
+ fields: {
+ min: {
+ type: "number"
+ },
+ max: {
+ optional: true,
+ type: "number"
+ }
+ }
+});
+defineType("Signature", {
+ unionType: ["Node"],
+ fields: {
+ params: {
+ array: true,
+ type: "FuncParam"
+ },
+ results: {
+ array: true,
+ type: "Valtype"
+ }
+ }
+});
+defineType("Program", {
+ unionType: ["Node"],
+ fields: {
+ body: {
+ array: true,
+ type: "Node"
+ }
+ }
+});
+defineType("Identifier", {
+ unionType: ["Node", "Expression"],
+ fields: {
+ value: {
+ type: "string"
+ },
+ raw: {
+ optional: true,
+ type: "string"
+ }
+ }
+});
+defineType("BlockInstruction", {
+ unionType: ["Node", "Block", "Instruction"],
+ fields: {
+ id: {
+ constant: true,
+ type: "string",
+ value: "block"
+ },
+ label: {
+ maybe: true,
+ type: "Identifier"
+ },
+ instr: {
+ array: true,
+ type: "Instruction"
+ },
+ result: {
+ maybe: true,
+ type: "Valtype"
+ }
+ }
+});
+defineType("CallInstruction", {
+ unionType: ["Node", "Instruction"],
+ fields: {
+ id: {
+ constant: true,
+ type: "string",
+ value: "call"
+ },
+ index: {
+ type: "Index"
+ },
+ instrArgs: {
+ array: true,
+ optional: true,
+ type: "Expression"
+ },
+ numeric: {
+ type: "Index",
+ optional: true
+ }
+ }
+});
+defineType("CallIndirectInstruction", {
+ unionType: ["Node", "Instruction"],
+ fields: {
+ id: {
+ constant: true,
+ type: "string",
+ value: "call_indirect"
+ },
+ signature: {
+ type: "SignatureOrTypeRef"
+ },
+ intrs: {
+ array: true,
+ optional: true,
+ type: "Expression"
+ }
+ }
+});
+defineType("ByteArray", {
+ unionType: ["Node"],
+ fields: {
+ values: {
+ array: true,
+ type: "Byte"
+ }
+ }
+});
+defineType("Func", {
+ unionType: ["Node", "Block"],
+ fields: {
+ name: {
+ maybe: true,
+ type: "Index"
+ },
+ signature: {
+ type: "SignatureOrTypeRef"
+ },
+ body: {
+ array: true,
+ type: "Instruction"
+ },
+ isExternal: {
+ comment: "means that it has been imported from the outside js",
+ optional: true,
+ type: "boolean"
+ },
+ metadata: {
+ optional: true,
+ type: "FuncMetadata"
+ }
+ }
+});
+/**
+ * Intrinsics
+ */
+
+defineType("InternalBrUnless", {
+ unionType: ["Node", "Intrinsic"],
+ fields: {
+ target: {
+ type: "number"
+ }
+ }
+});
+defineType("InternalGoto", {
+ unionType: ["Node", "Intrinsic"],
+ fields: {
+ target: {
+ type: "number"
+ }
+ }
+});
+defineType("InternalCallExtern", {
+ unionType: ["Node", "Intrinsic"],
+ fields: {
+ target: {
+ type: "number"
+ }
+ }
+}); // function bodies are terminated by an `end` instruction but are missing a
+// return instruction
+//
+// Since we can't inject a new instruction we are injecting a new instruction.
+
+defineType("InternalEndAndReturn", {
+ unionType: ["Node", "Intrinsic"],
+ fields: {}
+});
+module.exports = definitions; \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/lib/index.js b/node_modules/@webassemblyjs/ast/lib/index.js
new file mode 100644
index 0000000..e5dda7e
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/index.js
@@ -0,0 +1,118 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+var _exportNames = {
+ numberLiteralFromRaw: true,
+ withLoc: true,
+ withRaw: true,
+ funcParam: true,
+ indexLiteral: true,
+ memIndexLiteral: true,
+ instruction: true,
+ objectInstruction: true,
+ traverse: true,
+ signatures: true,
+ cloneNode: true
+};
+Object.defineProperty(exports, "numberLiteralFromRaw", {
+ enumerable: true,
+ get: function get() {
+ return _nodeHelpers.numberLiteralFromRaw;
+ }
+});
+Object.defineProperty(exports, "withLoc", {
+ enumerable: true,
+ get: function get() {
+ return _nodeHelpers.withLoc;
+ }
+});
+Object.defineProperty(exports, "withRaw", {
+ enumerable: true,
+ get: function get() {
+ return _nodeHelpers.withRaw;
+ }
+});
+Object.defineProperty(exports, "funcParam", {
+ enumerable: true,
+ get: function get() {
+ return _nodeHelpers.funcParam;
+ }
+});
+Object.defineProperty(exports, "indexLiteral", {
+ enumerable: true,
+ get: function get() {
+ return _nodeHelpers.indexLiteral;
+ }
+});
+Object.defineProperty(exports, "memIndexLiteral", {
+ enumerable: true,
+ get: function get() {
+ return _nodeHelpers.memIndexLiteral;
+ }
+});
+Object.defineProperty(exports, "instruction", {
+ enumerable: true,
+ get: function get() {
+ return _nodeHelpers.instruction;
+ }
+});
+Object.defineProperty(exports, "objectInstruction", {
+ enumerable: true,
+ get: function get() {
+ return _nodeHelpers.objectInstruction;
+ }
+});
+Object.defineProperty(exports, "traverse", {
+ enumerable: true,
+ get: function get() {
+ return _traverse.traverse;
+ }
+});
+Object.defineProperty(exports, "signatures", {
+ enumerable: true,
+ get: function get() {
+ return _signatures.signatures;
+ }
+});
+Object.defineProperty(exports, "cloneNode", {
+ enumerable: true,
+ get: function get() {
+ return _clone.cloneNode;
+ }
+});
+
+var _nodes = require("./nodes");
+
+Object.keys(_nodes).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function get() {
+ return _nodes[key];
+ }
+ });
+});
+
+var _nodeHelpers = require("./node-helpers.js");
+
+var _traverse = require("./traverse");
+
+var _signatures = require("./signatures");
+
+var _utils = require("./utils");
+
+Object.keys(_utils).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function get() {
+ return _utils[key];
+ }
+ });
+});
+
+var _clone = require("./clone"); \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/lib/node-helpers.js b/node_modules/@webassemblyjs/ast/lib/node-helpers.js
new file mode 100644
index 0000000..50dab1f
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/node-helpers.js
@@ -0,0 +1,107 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.numberLiteralFromRaw = numberLiteralFromRaw;
+exports.instruction = instruction;
+exports.objectInstruction = objectInstruction;
+exports.withLoc = withLoc;
+exports.withRaw = withRaw;
+exports.funcParam = funcParam;
+exports.indexLiteral = indexLiteral;
+exports.memIndexLiteral = memIndexLiteral;
+
+var _wastParser = require("@webassemblyjs/wast-parser");
+
+var _nodes = require("./nodes");
+
+function numberLiteralFromRaw(rawValue) {
+ var instructionType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "i32";
+ var original = rawValue; // Remove numeric separators _
+
+ if (typeof rawValue === "string") {
+ rawValue = rawValue.replace(/_/g, "");
+ }
+
+ if (typeof rawValue === "number") {
+ return (0, _nodes.numberLiteral)(rawValue, String(original));
+ } else {
+ switch (instructionType) {
+ case "i32":
+ {
+ return (0, _nodes.numberLiteral)((0, _wastParser.parse32I)(rawValue), String(original));
+ }
+
+ case "u32":
+ {
+ return (0, _nodes.numberLiteral)((0, _wastParser.parseU32)(rawValue), String(original));
+ }
+
+ case "i64":
+ {
+ return (0, _nodes.longNumberLiteral)((0, _wastParser.parse64I)(rawValue), String(original));
+ }
+
+ case "f32":
+ {
+ return (0, _nodes.floatLiteral)((0, _wastParser.parse32F)(rawValue), (0, _wastParser.isNanLiteral)(rawValue), (0, _wastParser.isInfLiteral)(rawValue), String(original));
+ }
+ // f64
+
+ default:
+ {
+ return (0, _nodes.floatLiteral)((0, _wastParser.parse64F)(rawValue), (0, _wastParser.isNanLiteral)(rawValue), (0, _wastParser.isInfLiteral)(rawValue), String(original));
+ }
+ }
+ }
+}
+
+function instruction(id) {
+ var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
+ var namedArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+ return (0, _nodes.instr)(id, undefined, args, namedArgs);
+}
+
+function objectInstruction(id, object) {
+ var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
+ var namedArgs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ return (0, _nodes.instr)(id, object, args, namedArgs);
+}
+/**
+ * Decorators
+ */
+
+
+function withLoc(n, end, start) {
+ var loc = {
+ start: start,
+ end: end
+ };
+ n.loc = loc;
+ return n;
+}
+
+function withRaw(n, raw) {
+ n.raw = raw;
+ return n;
+}
+
+function funcParam(valtype, id) {
+ return {
+ id: id,
+ valtype: valtype
+ };
+}
+
+function indexLiteral(value) {
+ // $FlowIgnore
+ var x = numberLiteralFromRaw(value, "u32");
+ return x;
+}
+
+function memIndexLiteral(value) {
+ // $FlowIgnore
+ var x = numberLiteralFromRaw(value, "u32");
+ return x;
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/lib/node-path.js b/node_modules/@webassemblyjs/ast/lib/node-path.js
new file mode 100644
index 0000000..cf85534
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/node-path.js
@@ -0,0 +1,144 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.createPath = createPath;
+
+function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
+
+function findParent(_ref, cb) {
+ var parentPath = _ref.parentPath;
+
+ if (parentPath == null) {
+ throw new Error("node is root");
+ }
+
+ var currentPath = parentPath;
+
+ while (cb(currentPath) !== false) {
+ // Hit the root node, stop
+ // $FlowIgnore
+ if (currentPath.parentPath == null) {
+ return null;
+ } // $FlowIgnore
+
+
+ currentPath = currentPath.parentPath;
+ }
+
+ return currentPath.node;
+}
+
+function insertBefore(context, newNode) {
+ return insert(context, newNode);
+}
+
+function insertAfter(context, newNode) {
+ return insert(context, newNode, 1);
+}
+
+function insert(_ref2, newNode) {
+ var node = _ref2.node,
+ inList = _ref2.inList,
+ parentPath = _ref2.parentPath,
+ parentKey = _ref2.parentKey;
+ var indexOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
+
+ if (!inList) {
+ throw new Error('inList' + " error: " + ("insert can only be used for nodes that are within lists" || "unknown"));
+ }
+
+ if (!(parentPath != null)) {
+ throw new Error('parentPath != null' + " error: " + ("Can not remove root node" || "unknown"));
+ }
+
+ // $FlowIgnore
+ var parentList = parentPath.node[parentKey];
+ var indexInList = parentList.findIndex(function (n) {
+ return n === node;
+ });
+ parentList.splice(indexInList + indexOffset, 0, newNode);
+}
+
+function remove(_ref3) {
+ var node = _ref3.node,
+ parentKey = _ref3.parentKey,
+ parentPath = _ref3.parentPath;
+
+ if (!(parentPath != null)) {
+ throw new Error('parentPath != null' + " error: " + ("Can not remove root node" || "unknown"));
+ }
+
+ // $FlowIgnore
+ var parentNode = parentPath.node; // $FlowIgnore
+
+ var parentProperty = parentNode[parentKey];
+
+ if (Array.isArray(parentProperty)) {
+ // $FlowIgnore
+ parentNode[parentKey] = parentProperty.filter(function (n) {
+ return n !== node;
+ });
+ } else {
+ // $FlowIgnore
+ delete parentNode[parentKey];
+ }
+
+ node._deleted = true;
+}
+
+function stop(context) {
+ context.shouldStop = true;
+}
+
+function replaceWith(context, newNode) {
+ // $FlowIgnore
+ var parentNode = context.parentPath.node; // $FlowIgnore
+
+ var parentProperty = parentNode[context.parentKey];
+
+ if (Array.isArray(parentProperty)) {
+ var indexInList = parentProperty.findIndex(function (n) {
+ return n === context.node;
+ });
+ parentProperty.splice(indexInList, 1, newNode);
+ } else {
+ // $FlowIgnore
+ parentNode[context.parentKey] = newNode;
+ }
+
+ context.node._deleted = true;
+ context.node = newNode;
+} // bind the context to the first argument of node operations
+
+
+function bindNodeOperations(operations, context) {
+ var keys = Object.keys(operations);
+ var boundOperations = {};
+ keys.forEach(function (key) {
+ boundOperations[key] = operations[key].bind(null, context);
+ });
+ return boundOperations;
+}
+
+function createPathOperations(context) {
+ // $FlowIgnore
+ return bindNodeOperations({
+ findParent: findParent,
+ replaceWith: replaceWith,
+ remove: remove,
+ insertBefore: insertBefore,
+ insertAfter: insertAfter,
+ stop: stop
+ }, context);
+}
+
+function createPath(context) {
+ var path = _extends({}, context); // $FlowIgnore
+
+
+ Object.assign(path, createPathOperations(path)); // $FlowIgnore
+
+ return path;
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/lib/nodes.js b/node_modules/@webassemblyjs/ast/lib/nodes.js
new file mode 100644
index 0000000..d99db0f
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/nodes.js
@@ -0,0 +1,1134 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.module = _module;
+exports.moduleMetadata = moduleMetadata;
+exports.moduleNameMetadata = moduleNameMetadata;
+exports.functionNameMetadata = functionNameMetadata;
+exports.localNameMetadata = localNameMetadata;
+exports.binaryModule = binaryModule;
+exports.quoteModule = quoteModule;
+exports.sectionMetadata = sectionMetadata;
+exports.producersSectionMetadata = producersSectionMetadata;
+exports.producerMetadata = producerMetadata;
+exports.producerMetadataVersionedName = producerMetadataVersionedName;
+exports.loopInstruction = loopInstruction;
+exports.instr = instr;
+exports.ifInstruction = ifInstruction;
+exports.stringLiteral = stringLiteral;
+exports.numberLiteral = numberLiteral;
+exports.longNumberLiteral = longNumberLiteral;
+exports.floatLiteral = floatLiteral;
+exports.elem = elem;
+exports.indexInFuncSection = indexInFuncSection;
+exports.valtypeLiteral = valtypeLiteral;
+exports.typeInstruction = typeInstruction;
+exports.start = start;
+exports.globalType = globalType;
+exports.leadingComment = leadingComment;
+exports.blockComment = blockComment;
+exports.data = data;
+exports.global = global;
+exports.table = table;
+exports.memory = memory;
+exports.funcImportDescr = funcImportDescr;
+exports.moduleImport = moduleImport;
+exports.moduleExportDescr = moduleExportDescr;
+exports.moduleExport = moduleExport;
+exports.limit = limit;
+exports.signature = signature;
+exports.program = program;
+exports.identifier = identifier;
+exports.blockInstruction = blockInstruction;
+exports.callInstruction = callInstruction;
+exports.callIndirectInstruction = callIndirectInstruction;
+exports.byteArray = byteArray;
+exports.func = func;
+exports.internalBrUnless = internalBrUnless;
+exports.internalGoto = internalGoto;
+exports.internalCallExtern = internalCallExtern;
+exports.internalEndAndReturn = internalEndAndReturn;
+exports.assertInternalCallExtern = exports.assertInternalGoto = exports.assertInternalBrUnless = exports.assertFunc = exports.assertByteArray = exports.assertCallIndirectInstruction = exports.assertCallInstruction = exports.assertBlockInstruction = exports.assertIdentifier = exports.assertProgram = exports.assertSignature = exports.assertLimit = exports.assertModuleExport = exports.assertModuleExportDescr = exports.assertModuleImport = exports.assertFuncImportDescr = exports.assertMemory = exports.assertTable = exports.assertGlobal = exports.assertData = exports.assertBlockComment = exports.assertLeadingComment = exports.assertGlobalType = exports.assertStart = exports.assertTypeInstruction = exports.assertValtypeLiteral = exports.assertIndexInFuncSection = exports.assertElem = exports.assertFloatLiteral = exports.assertLongNumberLiteral = exports.assertNumberLiteral = exports.assertStringLiteral = exports.assertIfInstruction = exports.assertInstr = exports.assertLoopInstruction = exports.assertProducerMetadataVersionedName = exports.assertProducerMetadata = exports.assertProducersSectionMetadata = exports.assertSectionMetadata = exports.assertQuoteModule = exports.assertBinaryModule = exports.assertLocalNameMetadata = exports.assertFunctionNameMetadata = exports.assertModuleNameMetadata = exports.assertModuleMetadata = exports.assertModule = exports.isIntrinsic = exports.isImportDescr = exports.isNumericLiteral = exports.isExpression = exports.isInstruction = exports.isBlock = exports.isNode = exports.isInternalEndAndReturn = exports.isInternalCallExtern = exports.isInternalGoto = exports.isInternalBrUnless = exports.isFunc = exports.isByteArray = exports.isCallIndirectInstruction = exports.isCallInstruction = exports.isBlockInstruction = exports.isIdentifier = exports.isProgram = exports.isSignature = exports.isLimit = exports.isModuleExport = exports.isModuleExportDescr = exports.isModuleImport = exports.isFuncImportDescr = exports.isMemory = exports.isTable = exports.isGlobal = exports.isData = exports.isBlockComment = exports.isLeadingComment = exports.isGlobalType = exports.isStart = exports.isTypeInstruction = exports.isValtypeLiteral = exports.isIndexInFuncSection = exports.isElem = exports.isFloatLiteral = exports.isLongNumberLiteral = exports.isNumberLiteral = exports.isStringLiteral = exports.isIfInstruction = exports.isInstr = exports.isLoopInstruction = exports.isProducerMetadataVersionedName = exports.isProducerMetadata = exports.isProducersSectionMetadata = exports.isSectionMetadata = exports.isQuoteModule = exports.isBinaryModule = exports.isLocalNameMetadata = exports.isFunctionNameMetadata = exports.isModuleNameMetadata = exports.isModuleMetadata = exports.isModule = void 0;
+exports.nodeAndUnionTypes = exports.unionTypesMap = exports.assertInternalEndAndReturn = void 0;
+
+function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
+// THIS FILE IS AUTOGENERATED
+// see scripts/generateNodeUtils.js
+function isTypeOf(t) {
+ return function (n) {
+ return n.type === t;
+ };
+}
+
+function assertTypeOf(t) {
+ return function (n) {
+ return function () {
+ if (!(n.type === t)) {
+ throw new Error('n.type === t' + " error: " + (undefined || "unknown"));
+ }
+ }();
+ };
+}
+
+function _module(id, fields, metadata) {
+ if (id !== null && id !== undefined) {
+ if (!(typeof id === "string")) {
+ throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
+ }
+ }
+
+ if (!(_typeof(fields) === "object" && typeof fields.length !== "undefined")) {
+ throw new Error('typeof fields === "object" && typeof fields.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "Module",
+ id: id,
+ fields: fields
+ };
+
+ if (typeof metadata !== "undefined") {
+ node.metadata = metadata;
+ }
+
+ return node;
+}
+
+function moduleMetadata(sections, functionNames, localNames, producers) {
+ if (!(_typeof(sections) === "object" && typeof sections.length !== "undefined")) {
+ throw new Error('typeof sections === "object" && typeof sections.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (functionNames !== null && functionNames !== undefined) {
+ if (!(_typeof(functionNames) === "object" && typeof functionNames.length !== "undefined")) {
+ throw new Error('typeof functionNames === "object" && typeof functionNames.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+ }
+
+ if (localNames !== null && localNames !== undefined) {
+ if (!(_typeof(localNames) === "object" && typeof localNames.length !== "undefined")) {
+ throw new Error('typeof localNames === "object" && typeof localNames.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+ }
+
+ if (producers !== null && producers !== undefined) {
+ if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) {
+ throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "ModuleMetadata",
+ sections: sections
+ };
+
+ if (typeof functionNames !== "undefined" && functionNames.length > 0) {
+ node.functionNames = functionNames;
+ }
+
+ if (typeof localNames !== "undefined" && localNames.length > 0) {
+ node.localNames = localNames;
+ }
+
+ if (typeof producers !== "undefined" && producers.length > 0) {
+ node.producers = producers;
+ }
+
+ return node;
+}
+
+function moduleNameMetadata(value) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ var node = {
+ type: "ModuleNameMetadata",
+ value: value
+ };
+ return node;
+}
+
+function functionNameMetadata(value, index) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ if (!(typeof index === "number")) {
+ throw new Error('typeof index === "number"' + " error: " + ("Argument index must be of type number, given: " + _typeof(index) || "unknown"));
+ }
+
+ var node = {
+ type: "FunctionNameMetadata",
+ value: value,
+ index: index
+ };
+ return node;
+}
+
+function localNameMetadata(value, localIndex, functionIndex) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ if (!(typeof localIndex === "number")) {
+ throw new Error('typeof localIndex === "number"' + " error: " + ("Argument localIndex must be of type number, given: " + _typeof(localIndex) || "unknown"));
+ }
+
+ if (!(typeof functionIndex === "number")) {
+ throw new Error('typeof functionIndex === "number"' + " error: " + ("Argument functionIndex must be of type number, given: " + _typeof(functionIndex) || "unknown"));
+ }
+
+ var node = {
+ type: "LocalNameMetadata",
+ value: value,
+ localIndex: localIndex,
+ functionIndex: functionIndex
+ };
+ return node;
+}
+
+function binaryModule(id, blob) {
+ if (id !== null && id !== undefined) {
+ if (!(typeof id === "string")) {
+ throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
+ }
+ }
+
+ if (!(_typeof(blob) === "object" && typeof blob.length !== "undefined")) {
+ throw new Error('typeof blob === "object" && typeof blob.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "BinaryModule",
+ id: id,
+ blob: blob
+ };
+ return node;
+}
+
+function quoteModule(id, string) {
+ if (id !== null && id !== undefined) {
+ if (!(typeof id === "string")) {
+ throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
+ }
+ }
+
+ if (!(_typeof(string) === "object" && typeof string.length !== "undefined")) {
+ throw new Error('typeof string === "object" && typeof string.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "QuoteModule",
+ id: id,
+ string: string
+ };
+ return node;
+}
+
+function sectionMetadata(section, startOffset, size, vectorOfSize) {
+ if (!(typeof startOffset === "number")) {
+ throw new Error('typeof startOffset === "number"' + " error: " + ("Argument startOffset must be of type number, given: " + _typeof(startOffset) || "unknown"));
+ }
+
+ var node = {
+ type: "SectionMetadata",
+ section: section,
+ startOffset: startOffset,
+ size: size,
+ vectorOfSize: vectorOfSize
+ };
+ return node;
+}
+
+function producersSectionMetadata(producers) {
+ if (!(_typeof(producers) === "object" && typeof producers.length !== "undefined")) {
+ throw new Error('typeof producers === "object" && typeof producers.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "ProducersSectionMetadata",
+ producers: producers
+ };
+ return node;
+}
+
+function producerMetadata(language, processedBy, sdk) {
+ if (!(_typeof(language) === "object" && typeof language.length !== "undefined")) {
+ throw new Error('typeof language === "object" && typeof language.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (!(_typeof(processedBy) === "object" && typeof processedBy.length !== "undefined")) {
+ throw new Error('typeof processedBy === "object" && typeof processedBy.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (!(_typeof(sdk) === "object" && typeof sdk.length !== "undefined")) {
+ throw new Error('typeof sdk === "object" && typeof sdk.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "ProducerMetadata",
+ language: language,
+ processedBy: processedBy,
+ sdk: sdk
+ };
+ return node;
+}
+
+function producerMetadataVersionedName(name, version) {
+ if (!(typeof name === "string")) {
+ throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
+ }
+
+ if (!(typeof version === "string")) {
+ throw new Error('typeof version === "string"' + " error: " + ("Argument version must be of type string, given: " + _typeof(version) || "unknown"));
+ }
+
+ var node = {
+ type: "ProducerMetadataVersionedName",
+ name: name,
+ version: version
+ };
+ return node;
+}
+
+function loopInstruction(label, resulttype, instr) {
+ if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) {
+ throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "LoopInstruction",
+ id: "loop",
+ label: label,
+ resulttype: resulttype,
+ instr: instr
+ };
+ return node;
+}
+
+function instr(id, object, args, namedArgs) {
+ if (!(typeof id === "string")) {
+ throw new Error('typeof id === "string"' + " error: " + ("Argument id must be of type string, given: " + _typeof(id) || "unknown"));
+ }
+
+ if (!(_typeof(args) === "object" && typeof args.length !== "undefined")) {
+ throw new Error('typeof args === "object" && typeof args.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "Instr",
+ id: id,
+ args: args
+ };
+
+ if (typeof object !== "undefined") {
+ node.object = object;
+ }
+
+ if (typeof namedArgs !== "undefined" && Object.keys(namedArgs).length !== 0) {
+ node.namedArgs = namedArgs;
+ }
+
+ return node;
+}
+
+function ifInstruction(testLabel, test, result, consequent, alternate) {
+ if (!(_typeof(test) === "object" && typeof test.length !== "undefined")) {
+ throw new Error('typeof test === "object" && typeof test.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (!(_typeof(consequent) === "object" && typeof consequent.length !== "undefined")) {
+ throw new Error('typeof consequent === "object" && typeof consequent.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (!(_typeof(alternate) === "object" && typeof alternate.length !== "undefined")) {
+ throw new Error('typeof alternate === "object" && typeof alternate.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "IfInstruction",
+ id: "if",
+ testLabel: testLabel,
+ test: test,
+ result: result,
+ consequent: consequent,
+ alternate: alternate
+ };
+ return node;
+}
+
+function stringLiteral(value) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ var node = {
+ type: "StringLiteral",
+ value: value
+ };
+ return node;
+}
+
+function numberLiteral(value, raw) {
+ if (!(typeof value === "number")) {
+ throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown"));
+ }
+
+ if (!(typeof raw === "string")) {
+ throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
+ }
+
+ var node = {
+ type: "NumberLiteral",
+ value: value,
+ raw: raw
+ };
+ return node;
+}
+
+function longNumberLiteral(value, raw) {
+ if (!(typeof raw === "string")) {
+ throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
+ }
+
+ var node = {
+ type: "LongNumberLiteral",
+ value: value,
+ raw: raw
+ };
+ return node;
+}
+
+function floatLiteral(value, nan, inf, raw) {
+ if (!(typeof value === "number")) {
+ throw new Error('typeof value === "number"' + " error: " + ("Argument value must be of type number, given: " + _typeof(value) || "unknown"));
+ }
+
+ if (nan !== null && nan !== undefined) {
+ if (!(typeof nan === "boolean")) {
+ throw new Error('typeof nan === "boolean"' + " error: " + ("Argument nan must be of type boolean, given: " + _typeof(nan) || "unknown"));
+ }
+ }
+
+ if (inf !== null && inf !== undefined) {
+ if (!(typeof inf === "boolean")) {
+ throw new Error('typeof inf === "boolean"' + " error: " + ("Argument inf must be of type boolean, given: " + _typeof(inf) || "unknown"));
+ }
+ }
+
+ if (!(typeof raw === "string")) {
+ throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
+ }
+
+ var node = {
+ type: "FloatLiteral",
+ value: value,
+ raw: raw
+ };
+
+ if (nan === true) {
+ node.nan = true;
+ }
+
+ if (inf === true) {
+ node.inf = true;
+ }
+
+ return node;
+}
+
+function elem(table, offset, funcs) {
+ if (!(_typeof(offset) === "object" && typeof offset.length !== "undefined")) {
+ throw new Error('typeof offset === "object" && typeof offset.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (!(_typeof(funcs) === "object" && typeof funcs.length !== "undefined")) {
+ throw new Error('typeof funcs === "object" && typeof funcs.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "Elem",
+ table: table,
+ offset: offset,
+ funcs: funcs
+ };
+ return node;
+}
+
+function indexInFuncSection(index) {
+ var node = {
+ type: "IndexInFuncSection",
+ index: index
+ };
+ return node;
+}
+
+function valtypeLiteral(name) {
+ var node = {
+ type: "ValtypeLiteral",
+ name: name
+ };
+ return node;
+}
+
+function typeInstruction(id, functype) {
+ var node = {
+ type: "TypeInstruction",
+ id: id,
+ functype: functype
+ };
+ return node;
+}
+
+function start(index) {
+ var node = {
+ type: "Start",
+ index: index
+ };
+ return node;
+}
+
+function globalType(valtype, mutability) {
+ var node = {
+ type: "GlobalType",
+ valtype: valtype,
+ mutability: mutability
+ };
+ return node;
+}
+
+function leadingComment(value) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ var node = {
+ type: "LeadingComment",
+ value: value
+ };
+ return node;
+}
+
+function blockComment(value) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ var node = {
+ type: "BlockComment",
+ value: value
+ };
+ return node;
+}
+
+function data(memoryIndex, offset, init) {
+ var node = {
+ type: "Data",
+ memoryIndex: memoryIndex,
+ offset: offset,
+ init: init
+ };
+ return node;
+}
+
+function global(globalType, init, name) {
+ if (!(_typeof(init) === "object" && typeof init.length !== "undefined")) {
+ throw new Error('typeof init === "object" && typeof init.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "Global",
+ globalType: globalType,
+ init: init,
+ name: name
+ };
+ return node;
+}
+
+function table(elementType, limits, name, elements) {
+ if (!(limits.type === "Limit")) {
+ throw new Error('limits.type === "Limit"' + " error: " + ("Argument limits must be of type Limit, given: " + limits.type || "unknown"));
+ }
+
+ if (elements !== null && elements !== undefined) {
+ if (!(_typeof(elements) === "object" && typeof elements.length !== "undefined")) {
+ throw new Error('typeof elements === "object" && typeof elements.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "Table",
+ elementType: elementType,
+ limits: limits,
+ name: name
+ };
+
+ if (typeof elements !== "undefined" && elements.length > 0) {
+ node.elements = elements;
+ }
+
+ return node;
+}
+
+function memory(limits, id) {
+ var node = {
+ type: "Memory",
+ limits: limits,
+ id: id
+ };
+ return node;
+}
+
+function funcImportDescr(id, signature) {
+ var node = {
+ type: "FuncImportDescr",
+ id: id,
+ signature: signature
+ };
+ return node;
+}
+
+function moduleImport(module, name, descr) {
+ if (!(typeof module === "string")) {
+ throw new Error('typeof module === "string"' + " error: " + ("Argument module must be of type string, given: " + _typeof(module) || "unknown"));
+ }
+
+ if (!(typeof name === "string")) {
+ throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
+ }
+
+ var node = {
+ type: "ModuleImport",
+ module: module,
+ name: name,
+ descr: descr
+ };
+ return node;
+}
+
+function moduleExportDescr(exportType, id) {
+ var node = {
+ type: "ModuleExportDescr",
+ exportType: exportType,
+ id: id
+ };
+ return node;
+}
+
+function moduleExport(name, descr) {
+ if (!(typeof name === "string")) {
+ throw new Error('typeof name === "string"' + " error: " + ("Argument name must be of type string, given: " + _typeof(name) || "unknown"));
+ }
+
+ var node = {
+ type: "ModuleExport",
+ name: name,
+ descr: descr
+ };
+ return node;
+}
+
+function limit(min, max) {
+ if (!(typeof min === "number")) {
+ throw new Error('typeof min === "number"' + " error: " + ("Argument min must be of type number, given: " + _typeof(min) || "unknown"));
+ }
+
+ if (max !== null && max !== undefined) {
+ if (!(typeof max === "number")) {
+ throw new Error('typeof max === "number"' + " error: " + ("Argument max must be of type number, given: " + _typeof(max) || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "Limit",
+ min: min
+ };
+
+ if (typeof max !== "undefined") {
+ node.max = max;
+ }
+
+ return node;
+}
+
+function signature(params, results) {
+ if (!(_typeof(params) === "object" && typeof params.length !== "undefined")) {
+ throw new Error('typeof params === "object" && typeof params.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (!(_typeof(results) === "object" && typeof results.length !== "undefined")) {
+ throw new Error('typeof results === "object" && typeof results.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "Signature",
+ params: params,
+ results: results
+ };
+ return node;
+}
+
+function program(body) {
+ if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) {
+ throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "Program",
+ body: body
+ };
+ return node;
+}
+
+function identifier(value, raw) {
+ if (!(typeof value === "string")) {
+ throw new Error('typeof value === "string"' + " error: " + ("Argument value must be of type string, given: " + _typeof(value) || "unknown"));
+ }
+
+ if (raw !== null && raw !== undefined) {
+ if (!(typeof raw === "string")) {
+ throw new Error('typeof raw === "string"' + " error: " + ("Argument raw must be of type string, given: " + _typeof(raw) || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "Identifier",
+ value: value
+ };
+
+ if (typeof raw !== "undefined") {
+ node.raw = raw;
+ }
+
+ return node;
+}
+
+function blockInstruction(label, instr, result) {
+ if (!(_typeof(instr) === "object" && typeof instr.length !== "undefined")) {
+ throw new Error('typeof instr === "object" && typeof instr.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "BlockInstruction",
+ id: "block",
+ label: label,
+ instr: instr,
+ result: result
+ };
+ return node;
+}
+
+function callInstruction(index, instrArgs, numeric) {
+ if (instrArgs !== null && instrArgs !== undefined) {
+ if (!(_typeof(instrArgs) === "object" && typeof instrArgs.length !== "undefined")) {
+ throw new Error('typeof instrArgs === "object" && typeof instrArgs.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "CallInstruction",
+ id: "call",
+ index: index
+ };
+
+ if (typeof instrArgs !== "undefined" && instrArgs.length > 0) {
+ node.instrArgs = instrArgs;
+ }
+
+ if (typeof numeric !== "undefined") {
+ node.numeric = numeric;
+ }
+
+ return node;
+}
+
+function callIndirectInstruction(signature, intrs) {
+ if (intrs !== null && intrs !== undefined) {
+ if (!(_typeof(intrs) === "object" && typeof intrs.length !== "undefined")) {
+ throw new Error('typeof intrs === "object" && typeof intrs.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "CallIndirectInstruction",
+ id: "call_indirect",
+ signature: signature
+ };
+
+ if (typeof intrs !== "undefined" && intrs.length > 0) {
+ node.intrs = intrs;
+ }
+
+ return node;
+}
+
+function byteArray(values) {
+ if (!(_typeof(values) === "object" && typeof values.length !== "undefined")) {
+ throw new Error('typeof values === "object" && typeof values.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ var node = {
+ type: "ByteArray",
+ values: values
+ };
+ return node;
+}
+
+function func(name, signature, body, isExternal, metadata) {
+ if (!(_typeof(body) === "object" && typeof body.length !== "undefined")) {
+ throw new Error('typeof body === "object" && typeof body.length !== "undefined"' + " error: " + (undefined || "unknown"));
+ }
+
+ if (isExternal !== null && isExternal !== undefined) {
+ if (!(typeof isExternal === "boolean")) {
+ throw new Error('typeof isExternal === "boolean"' + " error: " + ("Argument isExternal must be of type boolean, given: " + _typeof(isExternal) || "unknown"));
+ }
+ }
+
+ var node = {
+ type: "Func",
+ name: name,
+ signature: signature,
+ body: body
+ };
+
+ if (isExternal === true) {
+ node.isExternal = true;
+ }
+
+ if (typeof metadata !== "undefined") {
+ node.metadata = metadata;
+ }
+
+ return node;
+}
+
+function internalBrUnless(target) {
+ if (!(typeof target === "number")) {
+ throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
+ }
+
+ var node = {
+ type: "InternalBrUnless",
+ target: target
+ };
+ return node;
+}
+
+function internalGoto(target) {
+ if (!(typeof target === "number")) {
+ throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
+ }
+
+ var node = {
+ type: "InternalGoto",
+ target: target
+ };
+ return node;
+}
+
+function internalCallExtern(target) {
+ if (!(typeof target === "number")) {
+ throw new Error('typeof target === "number"' + " error: " + ("Argument target must be of type number, given: " + _typeof(target) || "unknown"));
+ }
+
+ var node = {
+ type: "InternalCallExtern",
+ target: target
+ };
+ return node;
+}
+
+function internalEndAndReturn() {
+ var node = {
+ type: "InternalEndAndReturn"
+ };
+ return node;
+}
+
+var isModule = isTypeOf("Module");
+exports.isModule = isModule;
+var isModuleMetadata = isTypeOf("ModuleMetadata");
+exports.isModuleMetadata = isModuleMetadata;
+var isModuleNameMetadata = isTypeOf("ModuleNameMetadata");
+exports.isModuleNameMetadata = isModuleNameMetadata;
+var isFunctionNameMetadata = isTypeOf("FunctionNameMetadata");
+exports.isFunctionNameMetadata = isFunctionNameMetadata;
+var isLocalNameMetadata = isTypeOf("LocalNameMetadata");
+exports.isLocalNameMetadata = isLocalNameMetadata;
+var isBinaryModule = isTypeOf("BinaryModule");
+exports.isBinaryModule = isBinaryModule;
+var isQuoteModule = isTypeOf("QuoteModule");
+exports.isQuoteModule = isQuoteModule;
+var isSectionMetadata = isTypeOf("SectionMetadata");
+exports.isSectionMetadata = isSectionMetadata;
+var isProducersSectionMetadata = isTypeOf("ProducersSectionMetadata");
+exports.isProducersSectionMetadata = isProducersSectionMetadata;
+var isProducerMetadata = isTypeOf("ProducerMetadata");
+exports.isProducerMetadata = isProducerMetadata;
+var isProducerMetadataVersionedName = isTypeOf("ProducerMetadataVersionedName");
+exports.isProducerMetadataVersionedName = isProducerMetadataVersionedName;
+var isLoopInstruction = isTypeOf("LoopInstruction");
+exports.isLoopInstruction = isLoopInstruction;
+var isInstr = isTypeOf("Instr");
+exports.isInstr = isInstr;
+var isIfInstruction = isTypeOf("IfInstruction");
+exports.isIfInstruction = isIfInstruction;
+var isStringLiteral = isTypeOf("StringLiteral");
+exports.isStringLiteral = isStringLiteral;
+var isNumberLiteral = isTypeOf("NumberLiteral");
+exports.isNumberLiteral = isNumberLiteral;
+var isLongNumberLiteral = isTypeOf("LongNumberLiteral");
+exports.isLongNumberLiteral = isLongNumberLiteral;
+var isFloatLiteral = isTypeOf("FloatLiteral");
+exports.isFloatLiteral = isFloatLiteral;
+var isElem = isTypeOf("Elem");
+exports.isElem = isElem;
+var isIndexInFuncSection = isTypeOf("IndexInFuncSection");
+exports.isIndexInFuncSection = isIndexInFuncSection;
+var isValtypeLiteral = isTypeOf("ValtypeLiteral");
+exports.isValtypeLiteral = isValtypeLiteral;
+var isTypeInstruction = isTypeOf("TypeInstruction");
+exports.isTypeInstruction = isTypeInstruction;
+var isStart = isTypeOf("Start");
+exports.isStart = isStart;
+var isGlobalType = isTypeOf("GlobalType");
+exports.isGlobalType = isGlobalType;
+var isLeadingComment = isTypeOf("LeadingComment");
+exports.isLeadingComment = isLeadingComment;
+var isBlockComment = isTypeOf("BlockComment");
+exports.isBlockComment = isBlockComment;
+var isData = isTypeOf("Data");
+exports.isData = isData;
+var isGlobal = isTypeOf("Global");
+exports.isGlobal = isGlobal;
+var isTable = isTypeOf("Table");
+exports.isTable = isTable;
+var isMemory = isTypeOf("Memory");
+exports.isMemory = isMemory;
+var isFuncImportDescr = isTypeOf("FuncImportDescr");
+exports.isFuncImportDescr = isFuncImportDescr;
+var isModuleImport = isTypeOf("ModuleImport");
+exports.isModuleImport = isModuleImport;
+var isModuleExportDescr = isTypeOf("ModuleExportDescr");
+exports.isModuleExportDescr = isModuleExportDescr;
+var isModuleExport = isTypeOf("ModuleExport");
+exports.isModuleExport = isModuleExport;
+var isLimit = isTypeOf("Limit");
+exports.isLimit = isLimit;
+var isSignature = isTypeOf("Signature");
+exports.isSignature = isSignature;
+var isProgram = isTypeOf("Program");
+exports.isProgram = isProgram;
+var isIdentifier = isTypeOf("Identifier");
+exports.isIdentifier = isIdentifier;
+var isBlockInstruction = isTypeOf("BlockInstruction");
+exports.isBlockInstruction = isBlockInstruction;
+var isCallInstruction = isTypeOf("CallInstruction");
+exports.isCallInstruction = isCallInstruction;
+var isCallIndirectInstruction = isTypeOf("CallIndirectInstruction");
+exports.isCallIndirectInstruction = isCallIndirectInstruction;
+var isByteArray = isTypeOf("ByteArray");
+exports.isByteArray = isByteArray;
+var isFunc = isTypeOf("Func");
+exports.isFunc = isFunc;
+var isInternalBrUnless = isTypeOf("InternalBrUnless");
+exports.isInternalBrUnless = isInternalBrUnless;
+var isInternalGoto = isTypeOf("InternalGoto");
+exports.isInternalGoto = isInternalGoto;
+var isInternalCallExtern = isTypeOf("InternalCallExtern");
+exports.isInternalCallExtern = isInternalCallExtern;
+var isInternalEndAndReturn = isTypeOf("InternalEndAndReturn");
+exports.isInternalEndAndReturn = isInternalEndAndReturn;
+
+var isNode = function isNode(node) {
+ return isModule(node) || isModuleMetadata(node) || isModuleNameMetadata(node) || isFunctionNameMetadata(node) || isLocalNameMetadata(node) || isBinaryModule(node) || isQuoteModule(node) || isSectionMetadata(node) || isProducersSectionMetadata(node) || isProducerMetadata(node) || isProducerMetadataVersionedName(node) || isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isElem(node) || isIndexInFuncSection(node) || isValtypeLiteral(node) || isTypeInstruction(node) || isStart(node) || isGlobalType(node) || isLeadingComment(node) || isBlockComment(node) || isData(node) || isGlobal(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node) || isModuleImport(node) || isModuleExportDescr(node) || isModuleExport(node) || isLimit(node) || isSignature(node) || isProgram(node) || isIdentifier(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node) || isByteArray(node) || isFunc(node) || isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node);
+};
+
+exports.isNode = isNode;
+
+var isBlock = function isBlock(node) {
+ return isLoopInstruction(node) || isBlockInstruction(node) || isFunc(node);
+};
+
+exports.isBlock = isBlock;
+
+var isInstruction = function isInstruction(node) {
+ return isLoopInstruction(node) || isInstr(node) || isIfInstruction(node) || isTypeInstruction(node) || isBlockInstruction(node) || isCallInstruction(node) || isCallIndirectInstruction(node);
+};
+
+exports.isInstruction = isInstruction;
+
+var isExpression = function isExpression(node) {
+ return isInstr(node) || isStringLiteral(node) || isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node) || isValtypeLiteral(node) || isIdentifier(node);
+};
+
+exports.isExpression = isExpression;
+
+var isNumericLiteral = function isNumericLiteral(node) {
+ return isNumberLiteral(node) || isLongNumberLiteral(node) || isFloatLiteral(node);
+};
+
+exports.isNumericLiteral = isNumericLiteral;
+
+var isImportDescr = function isImportDescr(node) {
+ return isGlobalType(node) || isTable(node) || isMemory(node) || isFuncImportDescr(node);
+};
+
+exports.isImportDescr = isImportDescr;
+
+var isIntrinsic = function isIntrinsic(node) {
+ return isInternalBrUnless(node) || isInternalGoto(node) || isInternalCallExtern(node) || isInternalEndAndReturn(node);
+};
+
+exports.isIntrinsic = isIntrinsic;
+var assertModule = assertTypeOf("Module");
+exports.assertModule = assertModule;
+var assertModuleMetadata = assertTypeOf("ModuleMetadata");
+exports.assertModuleMetadata = assertModuleMetadata;
+var assertModuleNameMetadata = assertTypeOf("ModuleNameMetadata");
+exports.assertModuleNameMetadata = assertModuleNameMetadata;
+var assertFunctionNameMetadata = assertTypeOf("FunctionNameMetadata");
+exports.assertFunctionNameMetadata = assertFunctionNameMetadata;
+var assertLocalNameMetadata = assertTypeOf("LocalNameMetadata");
+exports.assertLocalNameMetadata = assertLocalNameMetadata;
+var assertBinaryModule = assertTypeOf("BinaryModule");
+exports.assertBinaryModule = assertBinaryModule;
+var assertQuoteModule = assertTypeOf("QuoteModule");
+exports.assertQuoteModule = assertQuoteModule;
+var assertSectionMetadata = assertTypeOf("SectionMetadata");
+exports.assertSectionMetadata = assertSectionMetadata;
+var assertProducersSectionMetadata = assertTypeOf("ProducersSectionMetadata");
+exports.assertProducersSectionMetadata = assertProducersSectionMetadata;
+var assertProducerMetadata = assertTypeOf("ProducerMetadata");
+exports.assertProducerMetadata = assertProducerMetadata;
+var assertProducerMetadataVersionedName = assertTypeOf("ProducerMetadataVersionedName");
+exports.assertProducerMetadataVersionedName = assertProducerMetadataVersionedName;
+var assertLoopInstruction = assertTypeOf("LoopInstruction");
+exports.assertLoopInstruction = assertLoopInstruction;
+var assertInstr = assertTypeOf("Instr");
+exports.assertInstr = assertInstr;
+var assertIfInstruction = assertTypeOf("IfInstruction");
+exports.assertIfInstruction = assertIfInstruction;
+var assertStringLiteral = assertTypeOf("StringLiteral");
+exports.assertStringLiteral = assertStringLiteral;
+var assertNumberLiteral = assertTypeOf("NumberLiteral");
+exports.assertNumberLiteral = assertNumberLiteral;
+var assertLongNumberLiteral = assertTypeOf("LongNumberLiteral");
+exports.assertLongNumberLiteral = assertLongNumberLiteral;
+var assertFloatLiteral = assertTypeOf("FloatLiteral");
+exports.assertFloatLiteral = assertFloatLiteral;
+var assertElem = assertTypeOf("Elem");
+exports.assertElem = assertElem;
+var assertIndexInFuncSection = assertTypeOf("IndexInFuncSection");
+exports.assertIndexInFuncSection = assertIndexInFuncSection;
+var assertValtypeLiteral = assertTypeOf("ValtypeLiteral");
+exports.assertValtypeLiteral = assertValtypeLiteral;
+var assertTypeInstruction = assertTypeOf("TypeInstruction");
+exports.assertTypeInstruction = assertTypeInstruction;
+var assertStart = assertTypeOf("Start");
+exports.assertStart = assertStart;
+var assertGlobalType = assertTypeOf("GlobalType");
+exports.assertGlobalType = assertGlobalType;
+var assertLeadingComment = assertTypeOf("LeadingComment");
+exports.assertLeadingComment = assertLeadingComment;
+var assertBlockComment = assertTypeOf("BlockComment");
+exports.assertBlockComment = assertBlockComment;
+var assertData = assertTypeOf("Data");
+exports.assertData = assertData;
+var assertGlobal = assertTypeOf("Global");
+exports.assertGlobal = assertGlobal;
+var assertTable = assertTypeOf("Table");
+exports.assertTable = assertTable;
+var assertMemory = assertTypeOf("Memory");
+exports.assertMemory = assertMemory;
+var assertFuncImportDescr = assertTypeOf("FuncImportDescr");
+exports.assertFuncImportDescr = assertFuncImportDescr;
+var assertModuleImport = assertTypeOf("ModuleImport");
+exports.assertModuleImport = assertModuleImport;
+var assertModuleExportDescr = assertTypeOf("ModuleExportDescr");
+exports.assertModuleExportDescr = assertModuleExportDescr;
+var assertModuleExport = assertTypeOf("ModuleExport");
+exports.assertModuleExport = assertModuleExport;
+var assertLimit = assertTypeOf("Limit");
+exports.assertLimit = assertLimit;
+var assertSignature = assertTypeOf("Signature");
+exports.assertSignature = assertSignature;
+var assertProgram = assertTypeOf("Program");
+exports.assertProgram = assertProgram;
+var assertIdentifier = assertTypeOf("Identifier");
+exports.assertIdentifier = assertIdentifier;
+var assertBlockInstruction = assertTypeOf("BlockInstruction");
+exports.assertBlockInstruction = assertBlockInstruction;
+var assertCallInstruction = assertTypeOf("CallInstruction");
+exports.assertCallInstruction = assertCallInstruction;
+var assertCallIndirectInstruction = assertTypeOf("CallIndirectInstruction");
+exports.assertCallIndirectInstruction = assertCallIndirectInstruction;
+var assertByteArray = assertTypeOf("ByteArray");
+exports.assertByteArray = assertByteArray;
+var assertFunc = assertTypeOf("Func");
+exports.assertFunc = assertFunc;
+var assertInternalBrUnless = assertTypeOf("InternalBrUnless");
+exports.assertInternalBrUnless = assertInternalBrUnless;
+var assertInternalGoto = assertTypeOf("InternalGoto");
+exports.assertInternalGoto = assertInternalGoto;
+var assertInternalCallExtern = assertTypeOf("InternalCallExtern");
+exports.assertInternalCallExtern = assertInternalCallExtern;
+var assertInternalEndAndReturn = assertTypeOf("InternalEndAndReturn");
+exports.assertInternalEndAndReturn = assertInternalEndAndReturn;
+var unionTypesMap = {
+ Module: ["Node"],
+ ModuleMetadata: ["Node"],
+ ModuleNameMetadata: ["Node"],
+ FunctionNameMetadata: ["Node"],
+ LocalNameMetadata: ["Node"],
+ BinaryModule: ["Node"],
+ QuoteModule: ["Node"],
+ SectionMetadata: ["Node"],
+ ProducersSectionMetadata: ["Node"],
+ ProducerMetadata: ["Node"],
+ ProducerMetadataVersionedName: ["Node"],
+ LoopInstruction: ["Node", "Block", "Instruction"],
+ Instr: ["Node", "Expression", "Instruction"],
+ IfInstruction: ["Node", "Instruction"],
+ StringLiteral: ["Node", "Expression"],
+ NumberLiteral: ["Node", "NumericLiteral", "Expression"],
+ LongNumberLiteral: ["Node", "NumericLiteral", "Expression"],
+ FloatLiteral: ["Node", "NumericLiteral", "Expression"],
+ Elem: ["Node"],
+ IndexInFuncSection: ["Node"],
+ ValtypeLiteral: ["Node", "Expression"],
+ TypeInstruction: ["Node", "Instruction"],
+ Start: ["Node"],
+ GlobalType: ["Node", "ImportDescr"],
+ LeadingComment: ["Node"],
+ BlockComment: ["Node"],
+ Data: ["Node"],
+ Global: ["Node"],
+ Table: ["Node", "ImportDescr"],
+ Memory: ["Node", "ImportDescr"],
+ FuncImportDescr: ["Node", "ImportDescr"],
+ ModuleImport: ["Node"],
+ ModuleExportDescr: ["Node"],
+ ModuleExport: ["Node"],
+ Limit: ["Node"],
+ Signature: ["Node"],
+ Program: ["Node"],
+ Identifier: ["Node", "Expression"],
+ BlockInstruction: ["Node", "Block", "Instruction"],
+ CallInstruction: ["Node", "Instruction"],
+ CallIndirectInstruction: ["Node", "Instruction"],
+ ByteArray: ["Node"],
+ Func: ["Node", "Block"],
+ InternalBrUnless: ["Node", "Intrinsic"],
+ InternalGoto: ["Node", "Intrinsic"],
+ InternalCallExtern: ["Node", "Intrinsic"],
+ InternalEndAndReturn: ["Node", "Intrinsic"]
+};
+exports.unionTypesMap = unionTypesMap;
+var nodeAndUnionTypes = ["Module", "ModuleMetadata", "ModuleNameMetadata", "FunctionNameMetadata", "LocalNameMetadata", "BinaryModule", "QuoteModule", "SectionMetadata", "ProducersSectionMetadata", "ProducerMetadata", "ProducerMetadataVersionedName", "LoopInstruction", "Instr", "IfInstruction", "StringLiteral", "NumberLiteral", "LongNumberLiteral", "FloatLiteral", "Elem", "IndexInFuncSection", "ValtypeLiteral", "TypeInstruction", "Start", "GlobalType", "LeadingComment", "BlockComment", "Data", "Global", "Table", "Memory", "FuncImportDescr", "ModuleImport", "ModuleExportDescr", "ModuleExport", "Limit", "Signature", "Program", "Identifier", "BlockInstruction", "CallInstruction", "CallIndirectInstruction", "ByteArray", "Func", "InternalBrUnless", "InternalGoto", "InternalCallExtern", "InternalEndAndReturn", "Node", "Block", "Instruction", "Expression", "NumericLiteral", "ImportDescr", "Intrinsic"];
+exports.nodeAndUnionTypes = nodeAndUnionTypes; \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/lib/signatures.js b/node_modules/@webassemblyjs/ast/lib/signatures.js
new file mode 100644
index 0000000..0efc766
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/signatures.js
@@ -0,0 +1,207 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.signatures = void 0;
+
+function sign(input, output) {
+ return [input, output];
+}
+
+var u32 = "u32";
+var i32 = "i32";
+var i64 = "i64";
+var f32 = "f32";
+var f64 = "f64";
+
+var vector = function vector(t) {
+ var vecType = [t]; // $FlowIgnore
+
+ vecType.vector = true;
+ return vecType;
+};
+
+var controlInstructions = {
+ unreachable: sign([], []),
+ nop: sign([], []),
+ // block ?
+ // loop ?
+ // if ?
+ // if else ?
+ br: sign([u32], []),
+ br_if: sign([u32], []),
+ br_table: sign(vector(u32), []),
+ return: sign([], []),
+ call: sign([u32], []),
+ call_indirect: sign([u32], [])
+};
+var parametricInstructions = {
+ drop: sign([], []),
+ select: sign([], [])
+};
+var variableInstructions = {
+ get_local: sign([u32], []),
+ set_local: sign([u32], []),
+ tee_local: sign([u32], []),
+ get_global: sign([u32], []),
+ set_global: sign([u32], [])
+};
+var memoryInstructions = {
+ "i32.load": sign([u32, u32], [i32]),
+ "i64.load": sign([u32, u32], []),
+ "f32.load": sign([u32, u32], []),
+ "f64.load": sign([u32, u32], []),
+ "i32.load8_s": sign([u32, u32], [i32]),
+ "i32.load8_u": sign([u32, u32], [i32]),
+ "i32.load16_s": sign([u32, u32], [i32]),
+ "i32.load16_u": sign([u32, u32], [i32]),
+ "i64.load8_s": sign([u32, u32], [i64]),
+ "i64.load8_u": sign([u32, u32], [i64]),
+ "i64.load16_s": sign([u32, u32], [i64]),
+ "i64.load16_u": sign([u32, u32], [i64]),
+ "i64.load32_s": sign([u32, u32], [i64]),
+ "i64.load32_u": sign([u32, u32], [i64]),
+ "i32.store": sign([u32, u32], []),
+ "i64.store": sign([u32, u32], []),
+ "f32.store": sign([u32, u32], []),
+ "f64.store": sign([u32, u32], []),
+ "i32.store8": sign([u32, u32], []),
+ "i32.store16": sign([u32, u32], []),
+ "i64.store8": sign([u32, u32], []),
+ "i64.store16": sign([u32, u32], []),
+ "i64.store32": sign([u32, u32], []),
+ current_memory: sign([], []),
+ grow_memory: sign([], [])
+};
+var numericInstructions = {
+ "i32.const": sign([i32], [i32]),
+ "i64.const": sign([i64], [i64]),
+ "f32.const": sign([f32], [f32]),
+ "f64.const": sign([f64], [f64]),
+ "i32.eqz": sign([i32], [i32]),
+ "i32.eq": sign([i32, i32], [i32]),
+ "i32.ne": sign([i32, i32], [i32]),
+ "i32.lt_s": sign([i32, i32], [i32]),
+ "i32.lt_u": sign([i32, i32], [i32]),
+ "i32.gt_s": sign([i32, i32], [i32]),
+ "i32.gt_u": sign([i32, i32], [i32]),
+ "i32.le_s": sign([i32, i32], [i32]),
+ "i32.le_u": sign([i32, i32], [i32]),
+ "i32.ge_s": sign([i32, i32], [i32]),
+ "i32.ge_u": sign([i32, i32], [i32]),
+ "i64.eqz": sign([i64], [i64]),
+ "i64.eq": sign([i64, i64], [i32]),
+ "i64.ne": sign([i64, i64], [i32]),
+ "i64.lt_s": sign([i64, i64], [i32]),
+ "i64.lt_u": sign([i64, i64], [i32]),
+ "i64.gt_s": sign([i64, i64], [i32]),
+ "i64.gt_u": sign([i64, i64], [i32]),
+ "i64.le_s": sign([i64, i64], [i32]),
+ "i64.le_u": sign([i64, i64], [i32]),
+ "i64.ge_s": sign([i64, i64], [i32]),
+ "i64.ge_u": sign([i64, i64], [i32]),
+ "f32.eq": sign([f32, f32], [i32]),
+ "f32.ne": sign([f32, f32], [i32]),
+ "f32.lt": sign([f32, f32], [i32]),
+ "f32.gt": sign([f32, f32], [i32]),
+ "f32.le": sign([f32, f32], [i32]),
+ "f32.ge": sign([f32, f32], [i32]),
+ "f64.eq": sign([f64, f64], [i32]),
+ "f64.ne": sign([f64, f64], [i32]),
+ "f64.lt": sign([f64, f64], [i32]),
+ "f64.gt": sign([f64, f64], [i32]),
+ "f64.le": sign([f64, f64], [i32]),
+ "f64.ge": sign([f64, f64], [i32]),
+ "i32.clz": sign([i32], [i32]),
+ "i32.ctz": sign([i32], [i32]),
+ "i32.popcnt": sign([i32], [i32]),
+ "i32.add": sign([i32, i32], [i32]),
+ "i32.sub": sign([i32, i32], [i32]),
+ "i32.mul": sign([i32, i32], [i32]),
+ "i32.div_s": sign([i32, i32], [i32]),
+ "i32.div_u": sign([i32, i32], [i32]),
+ "i32.rem_s": sign([i32, i32], [i32]),
+ "i32.rem_u": sign([i32, i32], [i32]),
+ "i32.and": sign([i32, i32], [i32]),
+ "i32.or": sign([i32, i32], [i32]),
+ "i32.xor": sign([i32, i32], [i32]),
+ "i32.shl": sign([i32, i32], [i32]),
+ "i32.shr_s": sign([i32, i32], [i32]),
+ "i32.shr_u": sign([i32, i32], [i32]),
+ "i32.rotl": sign([i32, i32], [i32]),
+ "i32.rotr": sign([i32, i32], [i32]),
+ "i64.clz": sign([i64], [i64]),
+ "i64.ctz": sign([i64], [i64]),
+ "i64.popcnt": sign([i64], [i64]),
+ "i64.add": sign([i64, i64], [i64]),
+ "i64.sub": sign([i64, i64], [i64]),
+ "i64.mul": sign([i64, i64], [i64]),
+ "i64.div_s": sign([i64, i64], [i64]),
+ "i64.div_u": sign([i64, i64], [i64]),
+ "i64.rem_s": sign([i64, i64], [i64]),
+ "i64.rem_u": sign([i64, i64], [i64]),
+ "i64.and": sign([i64, i64], [i64]),
+ "i64.or": sign([i64, i64], [i64]),
+ "i64.xor": sign([i64, i64], [i64]),
+ "i64.shl": sign([i64, i64], [i64]),
+ "i64.shr_s": sign([i64, i64], [i64]),
+ "i64.shr_u": sign([i64, i64], [i64]),
+ "i64.rotl": sign([i64, i64], [i64]),
+ "i64.rotr": sign([i64, i64], [i64]),
+ "f32.abs": sign([f32], [f32]),
+ "f32.neg": sign([f32], [f32]),
+ "f32.ceil": sign([f32], [f32]),
+ "f32.floor": sign([f32], [f32]),
+ "f32.trunc": sign([f32], [f32]),
+ "f32.nearest": sign([f32], [f32]),
+ "f32.sqrt": sign([f32], [f32]),
+ "f32.add": sign([f32, f32], [f32]),
+ "f32.sub": sign([f32, f32], [f32]),
+ "f32.mul": sign([f32, f32], [f32]),
+ "f32.div": sign([f32, f32], [f32]),
+ "f32.min": sign([f32, f32], [f32]),
+ "f32.max": sign([f32, f32], [f32]),
+ "f32.copysign": sign([f32, f32], [f32]),
+ "f64.abs": sign([f64], [f64]),
+ "f64.neg": sign([f64], [f64]),
+ "f64.ceil": sign([f64], [f64]),
+ "f64.floor": sign([f64], [f64]),
+ "f64.trunc": sign([f64], [f64]),
+ "f64.nearest": sign([f64], [f64]),
+ "f64.sqrt": sign([f64], [f64]),
+ "f64.add": sign([f64, f64], [f64]),
+ "f64.sub": sign([f64, f64], [f64]),
+ "f64.mul": sign([f64, f64], [f64]),
+ "f64.div": sign([f64, f64], [f64]),
+ "f64.min": sign([f64, f64], [f64]),
+ "f64.max": sign([f64, f64], [f64]),
+ "f64.copysign": sign([f64, f64], [f64]),
+ "i32.wrap/i64": sign([i64], [i32]),
+ "i32.trunc_s/f32": sign([f32], [i32]),
+ "i32.trunc_u/f32": sign([f32], [i32]),
+ "i32.trunc_s/f64": sign([f32], [i32]),
+ "i32.trunc_u/f64": sign([f64], [i32]),
+ "i64.extend_s/i32": sign([i32], [i64]),
+ "i64.extend_u/i32": sign([i32], [i64]),
+ "i64.trunc_s/f32": sign([f32], [i64]),
+ "i64.trunc_u/f32": sign([f32], [i64]),
+ "i64.trunc_s/f64": sign([f64], [i64]),
+ "i64.trunc_u/f64": sign([f64], [i64]),
+ "f32.convert_s/i32": sign([i32], [f32]),
+ "f32.convert_u/i32": sign([i32], [f32]),
+ "f32.convert_s/i64": sign([i64], [f32]),
+ "f32.convert_u/i64": sign([i64], [f32]),
+ "f32.demote/f64": sign([f64], [f32]),
+ "f64.convert_s/i32": sign([i32], [f64]),
+ "f64.convert_u/i32": sign([i32], [f64]),
+ "f64.convert_s/i64": sign([i64], [f64]),
+ "f64.convert_u/i64": sign([i64], [f64]),
+ "f64.promote/f32": sign([f32], [f64]),
+ "i32.reinterpret/f32": sign([f32], [i32]),
+ "i64.reinterpret/f64": sign([f64], [i64]),
+ "f32.reinterpret/i32": sign([i32], [f32]),
+ "f64.reinterpret/i64": sign([i64], [f64])
+};
+var signatures = Object.assign({}, controlInstructions, parametricInstructions, variableInstructions, memoryInstructions, numericInstructions);
+exports.signatures = signatures; \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/lib/transform/denormalize-type-references/index.js b/node_modules/@webassemblyjs/ast/lib/transform/denormalize-type-references/index.js
new file mode 100644
index 0000000..3258f84
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/transform/denormalize-type-references/index.js
@@ -0,0 +1,83 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.transform = transform;
+
+var t = require("../../index"); // func and call_indirect instructions can either define a signature inline, or
+// reference a signature, e.g.
+//
+// ;; inline signature
+// (func (result i64)
+// (i64.const 2)
+// )
+// ;; signature reference
+// (type (func (result i64)))
+// (func (type 0)
+// (i64.const 2))
+// )
+//
+// this AST transform denormalises the type references, making all signatures within the module
+// inline.
+
+
+function transform(ast) {
+ var typeInstructions = [];
+ t.traverse(ast, {
+ TypeInstruction: function TypeInstruction(_ref) {
+ var node = _ref.node;
+ typeInstructions.push(node);
+ }
+ });
+
+ if (!typeInstructions.length) {
+ return;
+ }
+
+ function denormalizeSignature(signature) {
+ // signature referenced by identifier
+ if (signature.type === "Identifier") {
+ var identifier = signature;
+ var typeInstruction = typeInstructions.find(function (t) {
+ return t.id.type === identifier.type && t.id.value === identifier.value;
+ });
+
+ if (!typeInstruction) {
+ throw new Error("A type instruction reference was not found ".concat(JSON.stringify(signature)));
+ }
+
+ return typeInstruction.functype;
+ } // signature referenced by index
+
+
+ if (signature.type === "NumberLiteral") {
+ var signatureRef = signature;
+ var _typeInstruction = typeInstructions[signatureRef.value];
+ return _typeInstruction.functype;
+ }
+
+ return signature;
+ }
+
+ t.traverse(ast, {
+ Func: function (_Func) {
+ function Func(_x) {
+ return _Func.apply(this, arguments);
+ }
+
+ Func.toString = function () {
+ return _Func.toString();
+ };
+
+ return Func;
+ }(function (_ref2) {
+ var node = _ref2.node;
+ node.signature = denormalizeSignature(node.signature);
+ }),
+ CallIndirectInstruction: function CallIndirectInstruction(_ref3) {
+ var node = _ref3.node;
+ node.signature = denormalizeSignature(node.signature);
+ }
+ });
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/lib/transform/wast-identifier-to-index/index.js b/node_modules/@webassemblyjs/ast/lib/transform/wast-identifier-to-index/index.js
new file mode 100644
index 0000000..33130bf
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/transform/wast-identifier-to-index/index.js
@@ -0,0 +1,225 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.transform = transform;
+
+var _index = require("../../index");
+
+var _helperModuleContext = require("@webassemblyjs/helper-module-context");
+
+function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
+function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
+
+function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }
+
+// FIXME(sven): do the same with all block instructions, must be more generic here
+function newUnexpectedFunction(i) {
+ return new Error("unknown function at offset: " + i);
+}
+
+function transform(ast) {
+ var module;
+ (0, _index.traverse)(ast, {
+ Module: function (_Module) {
+ function Module(_x) {
+ return _Module.apply(this, arguments);
+ }
+
+ Module.toString = function () {
+ return _Module.toString();
+ };
+
+ return Module;
+ }(function (path) {
+ module = path.node;
+ })
+ });
+ var moduleContext = (0, _helperModuleContext.moduleContextFromModuleAST)(module); // Transform the actual instruction in function bodies
+
+ (0, _index.traverse)(ast, {
+ Func: function (_Func) {
+ function Func(_x2) {
+ return _Func.apply(this, arguments);
+ }
+
+ Func.toString = function () {
+ return _Func.toString();
+ };
+
+ return Func;
+ }(function (path) {
+ transformFuncPath(path, moduleContext);
+ }),
+ Start: function (_Start) {
+ function Start(_x3) {
+ return _Start.apply(this, arguments);
+ }
+
+ Start.toString = function () {
+ return _Start.toString();
+ };
+
+ return Start;
+ }(function (path) {
+ var index = path.node.index;
+
+ if ((0, _index.isIdentifier)(index) === true) {
+ var offsetInModule = moduleContext.getFunctionOffsetByIdentifier(index.value);
+
+ if (typeof offsetInModule === "undefined") {
+ throw newUnexpectedFunction(index.value);
+ } // Replace the index Identifier
+ // $FlowIgnore: reference?
+
+
+ path.node.index = (0, _index.numberLiteralFromRaw)(offsetInModule);
+ }
+ })
+ });
+}
+
+function transformFuncPath(funcPath, moduleContext) {
+ var funcNode = funcPath.node;
+ var signature = funcNode.signature;
+
+ if (signature.type !== "Signature") {
+ throw new Error("Function signatures must be denormalised before execution");
+ }
+
+ var params = signature.params; // Add func locals in the context
+
+ params.forEach(function (p) {
+ return moduleContext.addLocal(p.valtype);
+ });
+ (0, _index.traverse)(funcNode, {
+ Instr: function (_Instr) {
+ function Instr(_x4) {
+ return _Instr.apply(this, arguments);
+ }
+
+ Instr.toString = function () {
+ return _Instr.toString();
+ };
+
+ return Instr;
+ }(function (instrPath) {
+ var instrNode = instrPath.node;
+ /**
+ * Local access
+ */
+
+ if (instrNode.id === "get_local" || instrNode.id === "set_local" || instrNode.id === "tee_local") {
+ var _instrNode$args = _slicedToArray(instrNode.args, 1),
+ firstArg = _instrNode$args[0];
+
+ if (firstArg.type === "Identifier") {
+ var offsetInParams = params.findIndex(function (_ref) {
+ var id = _ref.id;
+ return id === firstArg.value;
+ });
+
+ if (offsetInParams === -1) {
+ throw new Error("".concat(firstArg.value, " not found in ").concat(instrNode.id, ": not declared in func params"));
+ } // Replace the Identifer node by our new NumberLiteral node
+
+
+ instrNode.args[0] = (0, _index.numberLiteralFromRaw)(offsetInParams);
+ }
+ }
+ /**
+ * Global access
+ */
+
+
+ if (instrNode.id === "get_global" || instrNode.id === "set_global") {
+ var _instrNode$args2 = _slicedToArray(instrNode.args, 1),
+ _firstArg = _instrNode$args2[0];
+
+ if ((0, _index.isIdentifier)(_firstArg) === true) {
+ var globalOffset = moduleContext.getGlobalOffsetByIdentifier( // $FlowIgnore: reference?
+ _firstArg.value);
+
+ if (typeof globalOffset === "undefined") {
+ // $FlowIgnore: reference?
+ throw new Error("global ".concat(_firstArg.value, " not found in module"));
+ } // Replace the Identifer node by our new NumberLiteral node
+
+
+ instrNode.args[0] = (0, _index.numberLiteralFromRaw)(globalOffset);
+ }
+ }
+ /**
+ * Labels lookup
+ */
+
+
+ if (instrNode.id === "br") {
+ var _instrNode$args3 = _slicedToArray(instrNode.args, 1),
+ _firstArg2 = _instrNode$args3[0];
+
+ if ((0, _index.isIdentifier)(_firstArg2) === true) {
+ // if the labels is not found it is going to be replaced with -1
+ // which is invalid.
+ var relativeBlockCount = -1; // $FlowIgnore: reference?
+
+ instrPath.findParent(function (_ref2) {
+ var node = _ref2.node;
+
+ if ((0, _index.isBlock)(node)) {
+ relativeBlockCount++; // $FlowIgnore: reference?
+
+ var name = node.label || node.name;
+
+ if (_typeof(name) === "object") {
+ // $FlowIgnore: isIdentifier ensures that
+ if (name.value === _firstArg2.value) {
+ // Found it
+ return false;
+ }
+ }
+ }
+
+ if ((0, _index.isFunc)(node)) {
+ return false;
+ }
+ }); // Replace the Identifer node by our new NumberLiteral node
+
+ instrNode.args[0] = (0, _index.numberLiteralFromRaw)(relativeBlockCount);
+ }
+ }
+ }),
+
+ /**
+ * Func lookup
+ */
+ CallInstruction: function (_CallInstruction) {
+ function CallInstruction(_x5) {
+ return _CallInstruction.apply(this, arguments);
+ }
+
+ CallInstruction.toString = function () {
+ return _CallInstruction.toString();
+ };
+
+ return CallInstruction;
+ }(function (_ref3) {
+ var node = _ref3.node;
+ var index = node.index;
+
+ if ((0, _index.isIdentifier)(index) === true) {
+ var offsetInModule = moduleContext.getFunctionOffsetByIdentifier(index.value);
+
+ if (typeof offsetInModule === "undefined") {
+ throw newUnexpectedFunction(index.value);
+ } // Replace the index Identifier
+ // $FlowIgnore: reference?
+
+
+ node.index = (0, _index.numberLiteralFromRaw)(offsetInModule);
+ }
+ })
+ });
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/lib/traverse.js b/node_modules/@webassemblyjs/ast/lib/traverse.js
new file mode 100644
index 0000000..86803ce
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/traverse.js
@@ -0,0 +1,105 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.traverse = traverse;
+
+var _nodePath = require("./node-path");
+
+var _nodes = require("./nodes");
+
+// recursively walks the AST starting at the given node. The callback is invoked for
+// and object that has a 'type' property.
+function walk(context, callback) {
+ var stop = false;
+
+ function innerWalk(context, callback) {
+ if (stop) {
+ return;
+ }
+
+ var node = context.node;
+
+ if (node === undefined) {
+ console.warn("traversing with an empty context");
+ return;
+ }
+
+ if (node._deleted === true) {
+ return;
+ }
+
+ var path = (0, _nodePath.createPath)(context);
+ callback(node.type, path);
+
+ if (path.shouldStop) {
+ stop = true;
+ return;
+ }
+
+ Object.keys(node).forEach(function (prop) {
+ var value = node[prop];
+
+ if (value === null || value === undefined) {
+ return;
+ }
+
+ var valueAsArray = Array.isArray(value) ? value : [value];
+ valueAsArray.forEach(function (childNode) {
+ if (typeof childNode.type === "string") {
+ var childContext = {
+ node: childNode,
+ parentKey: prop,
+ parentPath: path,
+ shouldStop: false,
+ inList: Array.isArray(value)
+ };
+ innerWalk(childContext, callback);
+ }
+ });
+ });
+ }
+
+ innerWalk(context, callback);
+}
+
+var noop = function noop() {};
+
+function traverse(node, visitors) {
+ var before = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
+ var after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : noop;
+ Object.keys(visitors).forEach(function (visitor) {
+ if (!_nodes.nodeAndUnionTypes.includes(visitor)) {
+ throw new Error("Unexpected visitor ".concat(visitor));
+ }
+ });
+ var context = {
+ node: node,
+ inList: false,
+ shouldStop: false,
+ parentPath: null,
+ parentKey: null
+ };
+ walk(context, function (type, path) {
+ if (typeof visitors[type] === "function") {
+ before(type, path);
+ visitors[type](path);
+ after(type, path);
+ }
+
+ var unionTypes = _nodes.unionTypesMap[type];
+
+ if (!unionTypes) {
+ throw new Error("Unexpected node type ".concat(type));
+ }
+
+ unionTypes.forEach(function (unionType) {
+ if (typeof visitors[unionType] === "function") {
+ before(unionType, path);
+ visitors[unionType](path);
+ after(unionType, path);
+ }
+ });
+ });
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/lib/types/basic.js b/node_modules/@webassemblyjs/ast/lib/types/basic.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/types/basic.js
diff --git a/node_modules/@webassemblyjs/ast/lib/types/nodes.js b/node_modules/@webassemblyjs/ast/lib/types/nodes.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/types/nodes.js
diff --git a/node_modules/@webassemblyjs/ast/lib/types/traverse.js b/node_modules/@webassemblyjs/ast/lib/types/traverse.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/types/traverse.js
diff --git a/node_modules/@webassemblyjs/ast/lib/utils.js b/node_modules/@webassemblyjs/ast/lib/utils.js
new file mode 100644
index 0000000..d8330fc
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/lib/utils.js
@@ -0,0 +1,306 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isAnonymous = isAnonymous;
+exports.getSectionMetadata = getSectionMetadata;
+exports.getSectionMetadatas = getSectionMetadatas;
+exports.sortSectionMetadata = sortSectionMetadata;
+exports.orderedInsertNode = orderedInsertNode;
+exports.assertHasLoc = assertHasLoc;
+exports.getEndOfSection = getEndOfSection;
+exports.shiftLoc = shiftLoc;
+exports.shiftSection = shiftSection;
+exports.signatureForOpcode = signatureForOpcode;
+exports.getUniqueNameGenerator = getUniqueNameGenerator;
+exports.getStartByteOffset = getStartByteOffset;
+exports.getEndByteOffset = getEndByteOffset;
+exports.getFunctionBeginingByteOffset = getFunctionBeginingByteOffset;
+exports.getEndBlockByteOffset = getEndBlockByteOffset;
+exports.getStartBlockByteOffset = getStartBlockByteOffset;
+
+var _signatures = require("./signatures");
+
+var _traverse = require("./traverse");
+
+var _helperWasmBytecode = _interopRequireWildcard(require("@webassemblyjs/helper-wasm-bytecode"));
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
+
+function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
+
+function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }
+
+function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
+function isAnonymous(ident) {
+ return ident.raw === "";
+}
+
+function getSectionMetadata(ast, name) {
+ var section;
+ (0, _traverse.traverse)(ast, {
+ SectionMetadata: function (_SectionMetadata) {
+ function SectionMetadata(_x) {
+ return _SectionMetadata.apply(this, arguments);
+ }
+
+ SectionMetadata.toString = function () {
+ return _SectionMetadata.toString();
+ };
+
+ return SectionMetadata;
+ }(function (_ref) {
+ var node = _ref.node;
+
+ if (node.section === name) {
+ section = node;
+ }
+ })
+ });
+ return section;
+}
+
+function getSectionMetadatas(ast, name) {
+ var sections = [];
+ (0, _traverse.traverse)(ast, {
+ SectionMetadata: function (_SectionMetadata2) {
+ function SectionMetadata(_x2) {
+ return _SectionMetadata2.apply(this, arguments);
+ }
+
+ SectionMetadata.toString = function () {
+ return _SectionMetadata2.toString();
+ };
+
+ return SectionMetadata;
+ }(function (_ref2) {
+ var node = _ref2.node;
+
+ if (node.section === name) {
+ sections.push(node);
+ }
+ })
+ });
+ return sections;
+}
+
+function sortSectionMetadata(m) {
+ if (m.metadata == null) {
+ console.warn("sortSectionMetadata: no metadata to sort");
+ return;
+ } // $FlowIgnore
+
+
+ m.metadata.sections.sort(function (a, b) {
+ var aId = _helperWasmBytecode.default.sections[a.section];
+ var bId = _helperWasmBytecode.default.sections[b.section];
+
+ if (typeof aId !== "number" || typeof bId !== "number") {
+ throw new Error("Section id not found");
+ }
+
+ return aId - bId;
+ });
+}
+
+function orderedInsertNode(m, n) {
+ assertHasLoc(n);
+ var didInsert = false;
+
+ if (n.type === "ModuleExport") {
+ m.fields.push(n);
+ return;
+ }
+
+ m.fields = m.fields.reduce(function (acc, field) {
+ var fieldEndCol = Infinity;
+
+ if (field.loc != null) {
+ // $FlowIgnore
+ fieldEndCol = field.loc.end.column;
+ } // $FlowIgnore: assertHasLoc ensures that
+
+
+ if (didInsert === false && n.loc.start.column < fieldEndCol) {
+ didInsert = true;
+ acc.push(n);
+ }
+
+ acc.push(field);
+ return acc;
+ }, []); // Handles empty modules or n is the last element
+
+ if (didInsert === false) {
+ m.fields.push(n);
+ }
+}
+
+function assertHasLoc(n) {
+ if (n.loc == null || n.loc.start == null || n.loc.end == null) {
+ throw new Error("Internal failure: node (".concat(JSON.stringify(n.type), ") has no location information"));
+ }
+}
+
+function getEndOfSection(s) {
+ assertHasLoc(s.size);
+ return s.startOffset + s.size.value + ( // $FlowIgnore
+ s.size.loc.end.column - s.size.loc.start.column);
+}
+
+function shiftLoc(node, delta) {
+ // $FlowIgnore
+ node.loc.start.column += delta; // $FlowIgnore
+
+ node.loc.end.column += delta;
+}
+
+function shiftSection(ast, node, delta) {
+ if (node.type !== "SectionMetadata") {
+ throw new Error("Can not shift node " + JSON.stringify(node.type));
+ }
+
+ node.startOffset += delta;
+
+ if (_typeof(node.size.loc) === "object") {
+ shiftLoc(node.size, delta);
+ } // Custom sections doesn't have vectorOfSize
+
+
+ if (_typeof(node.vectorOfSize) === "object" && _typeof(node.vectorOfSize.loc) === "object") {
+ shiftLoc(node.vectorOfSize, delta);
+ }
+
+ var sectionName = node.section; // shift node locations within that section
+
+ (0, _traverse.traverse)(ast, {
+ Node: function Node(_ref3) {
+ var node = _ref3.node;
+ var section = (0, _helperWasmBytecode.getSectionForNode)(node);
+
+ if (section === sectionName && _typeof(node.loc) === "object") {
+ shiftLoc(node, delta);
+ }
+ }
+ });
+}
+
+function signatureForOpcode(object, name) {
+ var opcodeName = name;
+
+ if (object !== undefined && object !== "") {
+ opcodeName = object + "." + name;
+ }
+
+ var sign = _signatures.signatures[opcodeName];
+
+ if (sign == undefined) {
+ // TODO: Uncomment this when br_table and others has been done
+ //throw new Error("Invalid opcode: "+opcodeName);
+ return [object, object];
+ }
+
+ return sign[0];
+}
+
+function getUniqueNameGenerator() {
+ var inc = {};
+ return function () {
+ var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp";
+
+ if (!(prefix in inc)) {
+ inc[prefix] = 0;
+ } else {
+ inc[prefix] = inc[prefix] + 1;
+ }
+
+ return prefix + "_" + inc[prefix];
+ };
+}
+
+function getStartByteOffset(n) {
+ // $FlowIgnore
+ if (typeof n.loc === "undefined" || typeof n.loc.start === "undefined") {
+ throw new Error( // $FlowIgnore
+ "Can not get byte offset without loc informations, node: " + String(n.id));
+ }
+
+ return n.loc.start.column;
+}
+
+function getEndByteOffset(n) {
+ // $FlowIgnore
+ if (typeof n.loc === "undefined" || typeof n.loc.end === "undefined") {
+ throw new Error("Can not get byte offset without loc informations, node: " + n.type);
+ }
+
+ return n.loc.end.column;
+}
+
+function getFunctionBeginingByteOffset(n) {
+ if (!(n.body.length > 0)) {
+ throw new Error('n.body.length > 0' + " error: " + (undefined || "unknown"));
+ }
+
+ var _n$body = _slicedToArray(n.body, 1),
+ firstInstruction = _n$body[0];
+
+ return getStartByteOffset(firstInstruction);
+}
+
+function getEndBlockByteOffset(n) {
+ // $FlowIgnore
+ if (!(n.instr.length > 0 || n.body.length > 0)) {
+ throw new Error('n.instr.length > 0 || n.body.length > 0' + " error: " + (undefined || "unknown"));
+ }
+
+ var lastInstruction;
+
+ if (n.instr) {
+ // $FlowIgnore
+ lastInstruction = n.instr[n.instr.length - 1];
+ }
+
+ if (n.body) {
+ // $FlowIgnore
+ lastInstruction = n.body[n.body.length - 1];
+ }
+
+ if (!(_typeof(lastInstruction) === "object")) {
+ throw new Error('typeof lastInstruction === "object"' + " error: " + (undefined || "unknown"));
+ }
+
+ // $FlowIgnore
+ return getStartByteOffset(lastInstruction);
+}
+
+function getStartBlockByteOffset(n) {
+ // $FlowIgnore
+ if (!(n.instr.length > 0 || n.body.length > 0)) {
+ throw new Error('n.instr.length > 0 || n.body.length > 0' + " error: " + (undefined || "unknown"));
+ }
+
+ var fistInstruction;
+
+ if (n.instr) {
+ // $FlowIgnore
+ var _n$instr = _slicedToArray(n.instr, 1);
+
+ fistInstruction = _n$instr[0];
+ }
+
+ if (n.body) {
+ // $FlowIgnore
+ var _n$body2 = _slicedToArray(n.body, 1);
+
+ fistInstruction = _n$body2[0];
+ }
+
+ if (!(_typeof(fistInstruction) === "object")) {
+ throw new Error('typeof fistInstruction === "object"' + " error: " + (undefined || "unknown"));
+ }
+
+ // $FlowIgnore
+ return getStartByteOffset(fistInstruction);
+} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/ast/package.json b/node_modules/@webassemblyjs/ast/package.json
new file mode 100644
index 0000000..953fc2b
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/package.json
@@ -0,0 +1,73 @@
+{
+ "_from": "@webassemblyjs/ast@1.9.0",
+ "_id": "@webassemblyjs/ast@1.9.0",
+ "_inBundle": false,
+ "_integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==",
+ "_location": "/@webassemblyjs/ast",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "@webassemblyjs/ast@1.9.0",
+ "name": "@webassemblyjs/ast",
+ "escapedName": "@webassemblyjs%2fast",
+ "scope": "@webassemblyjs",
+ "rawSpec": "1.9.0",
+ "saveSpec": null,
+ "fetchSpec": "1.9.0"
+ },
+ "_requiredBy": [
+ "/@webassemblyjs/helper-module-context",
+ "/@webassemblyjs/helper-wasm-section",
+ "/@webassemblyjs/wasm-edit",
+ "/@webassemblyjs/wasm-gen",
+ "/@webassemblyjs/wasm-opt",
+ "/@webassemblyjs/wasm-parser",
+ "/@webassemblyjs/wast-parser",
+ "/@webassemblyjs/wast-printer",
+ "/webpack"
+ ],
+ "_resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz",
+ "_shasum": "bd850604b4042459a5a41cd7d338cbed695ed964",
+ "_spec": "@webassemblyjs/ast@1.9.0",
+ "_where": "/home/pruss/Dev/3-minute-website/node_modules/webpack",
+ "author": {
+ "name": "Sven Sauleau"
+ },
+ "bugs": {
+ "url": "https://github.com/xtuc/webassemblyjs/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "@webassemblyjs/helper-module-context": "1.9.0",
+ "@webassemblyjs/helper-wasm-bytecode": "1.9.0",
+ "@webassemblyjs/wast-parser": "1.9.0"
+ },
+ "deprecated": false,
+ "description": "AST utils for webassemblyjs",
+ "devDependencies": {
+ "@webassemblyjs/helper-test-framework": "1.9.0",
+ "array.prototype.flatmap": "^1.2.1",
+ "dump-exports": "^0.1.0",
+ "mamacro": "^0.0.7"
+ },
+ "gitHead": "0440b420888c1f7701eb9762ec657775506b87d8",
+ "homepage": "https://github.com/xtuc/webassemblyjs#readme",
+ "keywords": [
+ "webassembly",
+ "javascript",
+ "ast"
+ ],
+ "license": "MIT",
+ "main": "lib/index.js",
+ "module": "esm/index.js",
+ "name": "@webassemblyjs/ast",
+ "publishConfig": {
+ "access": "public"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/xtuc/webassemblyjs.git"
+ },
+ "version": "1.9.0"
+}
diff --git a/node_modules/@webassemblyjs/ast/scripts/generateNodeUtils.js b/node_modules/@webassemblyjs/ast/scripts/generateNodeUtils.js
new file mode 100644
index 0000000..46178a9
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/scripts/generateNodeUtils.js
@@ -0,0 +1,219 @@
+const definitions = require("../src/definitions");
+const flatMap = require("array.prototype.flatmap");
+const {
+ typeSignature,
+ iterateProps,
+ mapProps,
+ filterProps,
+ unique
+} = require("./util");
+
+const stdout = process.stdout;
+
+const jsTypes = ["string", "number", "boolean"];
+
+const quote = value => `"${value}"`;
+
+function params(fields) {
+ const optionalDefault = field => (field.default ? ` = ${field.default}` : "");
+ return mapProps(fields)
+ .map(field => `${typeSignature(field)}${optionalDefault(field)}`)
+ .join(",");
+}
+
+function assertParamType({ assertNodeType, array, name, type }) {
+ if (array) {
+ // TODO - assert contents of array?
+ return `assert(typeof ${name} === "object" && typeof ${name}.length !== "undefined")\n`;
+ } else {
+ if (jsTypes.includes(type)) {
+ return `assert(
+ typeof ${name} === "${type}",
+ "Argument ${name} must be of type ${type}, given: " + typeof ${name}
+ )`;
+ }
+
+ if (assertNodeType === true) {
+ return `assert(
+ ${name}.type === "${type}",
+ "Argument ${name} must be of type ${type}, given: " + ${name}.type
+ )`;
+ }
+
+ return "";
+ }
+}
+
+function assertParam(meta) {
+ const paramAssertion = assertParamType(meta);
+
+ if (paramAssertion === "") {
+ return "";
+ }
+
+ if (meta.maybe || meta.optional) {
+ return `
+ if (${meta.name} !== null && ${meta.name} !== undefined) {
+ ${paramAssertion};
+ }
+ `;
+ } else {
+ return paramAssertion;
+ }
+}
+
+function assertParams(fields) {
+ return mapProps(fields)
+ .map(assertParam)
+ .join("\n");
+}
+
+function buildObject(typeDef) {
+ const optionalField = meta => {
+ if (meta.array) {
+ // omit optional array properties if the constructor function was supplied
+ // with an empty array
+ return `
+ if (typeof ${meta.name} !== "undefined" && ${meta.name}.length > 0) {
+ node.${meta.name} = ${meta.name};
+ }
+ `;
+ } else if (meta.type === "Object") {
+ // omit optional object properties if they have no keys
+ return `
+ if (typeof ${meta.name} !== "undefined" && Object.keys(${
+ meta.name
+ }).length !== 0) {
+ node.${meta.name} = ${meta.name};
+ }
+ `;
+ } else if (meta.type === "boolean") {
+ // omit optional boolean properties if they are not true
+ return `
+ if (${meta.name} === true) {
+ node.${meta.name} = true;
+ }
+ `;
+ } else {
+ return `
+ if (typeof ${meta.name} !== "undefined") {
+ node.${meta.name} = ${meta.name};
+ }
+ `;
+ }
+ };
+
+ const fields = mapProps(typeDef.fields)
+ .filter(f => !f.optional && !f.constant)
+ .map(f => f.name);
+
+ const constants = mapProps(typeDef.fields)
+ .filter(f => f.constant)
+ .map(f => `${f.name}: "${f.value}"`);
+
+ return `
+ const node: ${typeDef.flowTypeName || typeDef.name} = {
+ type: "${typeDef.name}",
+ ${constants.concat(fields).join(",")}
+ }
+
+ ${mapProps(typeDef.fields)
+ .filter(f => f.optional)
+ .map(optionalField)
+ .join("")}
+ `;
+}
+
+function lowerCamelCase(name) {
+ return name.substring(0, 1).toLowerCase() + name.substring(1);
+}
+
+function generate() {
+ stdout.write(`
+ // @flow
+
+ // THIS FILE IS AUTOGENERATED
+ // see scripts/generateNodeUtils.js
+
+ import { assert } from "mamacro";
+
+ function isTypeOf(t: string) {
+ return (n: Node) => n.type === t;
+ }
+
+ function assertTypeOf(t: string) {
+ return (n: Node) => assert(n.type === t);
+ }
+ `);
+
+ // Node builders
+ iterateProps(definitions, typeDefinition => {
+ stdout.write(`
+ export function ${lowerCamelCase(typeDefinition.name)} (
+ ${params(filterProps(typeDefinition.fields, f => !f.constant))}
+ ): ${typeDefinition.name} {
+
+ ${assertParams(filterProps(typeDefinition.fields, f => !f.constant))}
+ ${buildObject(typeDefinition)}
+
+ return node;
+ }
+ `);
+ });
+
+ // Node testers
+ iterateProps(definitions, typeDefinition => {
+ stdout.write(`
+ export const is${typeDefinition.name} =
+ isTypeOf("${typeDefinition.name}");
+ `);
+ });
+
+ // Node union type testers
+ const unionTypes = unique(
+ flatMap(mapProps(definitions).filter(d => d.unionType), d => d.unionType)
+ );
+ unionTypes.forEach(unionType => {
+ stdout.write(
+ `
+ export const is${unionType} = (node: Node) => ` +
+ mapProps(definitions)
+ .filter(d => d.unionType && d.unionType.includes(unionType))
+ .map(d => `is${d.name}(node) `)
+ .join("||") +
+ ";\n\n"
+ );
+ });
+
+ // Node assertion
+ iterateProps(definitions, typeDefinition => {
+ stdout.write(`
+ export const assert${typeDefinition.name} =
+ assertTypeOf("${typeDefinition.name}");
+ `);
+ });
+
+ // a map from node type to its set of union types
+ stdout.write(
+ `
+ export const unionTypesMap = {` +
+ mapProps(definitions)
+ .filter(d => d.unionType)
+ .map(t => `"${t.name}": [${t.unionType.map(quote).join(",")}]\n`) +
+ `};
+ `
+ );
+
+ // an array of all node and union types
+ stdout.write(
+ `
+ export const nodeAndUnionTypes = [` +
+ mapProps(definitions)
+ .map(t => `"${t.name}"`)
+ .concat(unionTypes.map(quote))
+ .join(",") +
+ `];`
+ );
+}
+
+generate();
diff --git a/node_modules/@webassemblyjs/ast/scripts/generateTypeDefinitions.js b/node_modules/@webassemblyjs/ast/scripts/generateTypeDefinitions.js
new file mode 100644
index 0000000..99ba0ae
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/scripts/generateTypeDefinitions.js
@@ -0,0 +1,47 @@
+const definitions = require("../src/definitions");
+const flatMap = require("array.prototype.flatmap");
+const { typeSignature, mapProps, iterateProps, unique } = require("./util");
+
+const stdout = process.stdout;
+
+function params(fields) {
+ return mapProps(fields)
+ .map(typeSignature)
+ .join(",");
+}
+
+function generate() {
+ stdout.write(`
+ // @flow
+ /* eslint no-unused-vars: off */
+
+ // THIS FILE IS AUTOGENERATED
+ // see scripts/generateTypeDefinitions.js
+ `);
+
+ // generate union types
+ const unionTypes = unique(
+ flatMap(mapProps(definitions).filter(d => d.unionType), d => d.unionType)
+ );
+ unionTypes.forEach(unionType => {
+ stdout.write(
+ `type ${unionType} = ` +
+ mapProps(definitions)
+ .filter(d => d.unionType && d.unionType.includes(unionType))
+ .map(d => d.name)
+ .join("|") +
+ ";\n\n"
+ );
+ });
+
+ // generate the type definitions
+ iterateProps(definitions, typeDef => {
+ stdout.write(`type ${typeDef.name} = {
+ ...BaseNode,
+ type: "${typeDef.name}",
+ ${params(typeDef.fields)}
+ };\n\n`);
+ });
+}
+
+generate();
diff --git a/node_modules/@webassemblyjs/ast/scripts/util.js b/node_modules/@webassemblyjs/ast/scripts/util.js
new file mode 100644
index 0000000..c2ccfa0
--- /dev/null
+++ b/node_modules/@webassemblyjs/ast/scripts/util.js
@@ -0,0 +1,38 @@
+function iterateProps(obj, iterator) {
+ Object.keys(obj).forEach(key => iterator({ ...obj[key], name: key }));
+}
+
+function mapProps(obj) {
+ return Object.keys(obj).map(key => ({ ...obj[key], name: key }));
+}
+
+function filterProps(obj, filter) {
+ const ret = {};
+ Object.keys(obj).forEach(key => {
+ if (filter(obj[key])) {
+ ret[key] = obj[key];
+ }
+ });
+ return ret;
+}
+
+function typeSignature(meta) {
+ const type = meta.array ? `Array<${meta.type}>` : meta.type;
+ if (meta.optional) {
+ return `${meta.name}?: ${type}`;
+ } else if (meta.maybe) {
+ return `${meta.name}: ?${type}`;
+ } else {
+ return `${meta.name}: ${type}`;
+ }
+}
+
+const unique = items => Array.from(new Set(items));
+
+module.exports = {
+ iterateProps,
+ mapProps,
+ filterProps,
+ typeSignature,
+ unique
+};