@webassemblyjs/wasm-gen
Advanced tools
Comparing version 1.1.2-y.4 to 1.1.2-y.5
@@ -20,2 +20,3 @@ "use strict"; | ||
exports.encodeTypeInstruction = encodeTypeInstruction; | ||
exports.encodeInstr = encodeInstr; | ||
@@ -224,2 +225,16 @@ var _helperWasmBytecode = _interopRequireDefault(require("@webassemblyjs/helper-wasm-bytecode")); | ||
return out; | ||
} // FIXME(sven): find a better way for doing that | ||
function encodeInstr(n) { | ||
switch (n.id) { | ||
case "get_global": | ||
return [0x23].concat(_toConsumableArray(encodeU32(n.args[0].value))); | ||
case "set_global": | ||
return [0x24].concat(_toConsumableArray(encodeU32(n.args[0].value))); | ||
default: | ||
throw new Error("encodeInstr: unknown instruction " + JSON.stringify(n.id)); | ||
} | ||
} |
@@ -34,2 +34,5 @@ "use strict"; | ||
case "Instr": | ||
return encoder.encodeInstr(n); | ||
case "ModuleExport": | ||
@@ -36,0 +39,0 @@ // $FlowIgnore: SectionMetadata ensure that the node is well formated |
{ | ||
"name": "@webassemblyjs/wasm-gen", | ||
"version": "1.1.2-y.4", | ||
"version": "1.1.2-y.5", | ||
"description": "", | ||
@@ -19,6 +19,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@webassemblyjs/ast": "1.1.2-y.4", | ||
"@webassemblyjs/helper-leb128": "1.1.2-y.4", | ||
"@webassemblyjs/helper-wasm-bytecode": "1.1.2-y.4" | ||
"@webassemblyjs/ast": "1.1.2-y.5", | ||
"@webassemblyjs/helper-leb128": "1.1.2-y.5", | ||
"@webassemblyjs/helper-wasm-bytecode": "1.1.2-y.5" | ||
} | ||
} |
@@ -222,1 +222,15 @@ // @flow | ||
} | ||
// FIXME(sven): find a better way for doing that | ||
export function encodeInstr(n: Instruction) { | ||
switch (n.id) { | ||
case "get_global": | ||
return [0x23, ...encodeU32(n.args[0].value)]; | ||
case "set_global": | ||
return [0x24, ...encodeU32(n.args[0].value)]; | ||
default: | ||
throw new Error( | ||
"encodeInstr: unknown instruction " + JSON.stringify(n.id) | ||
); | ||
} | ||
} |
@@ -26,2 +26,5 @@ // @flow | ||
case "Instr": | ||
return encoder.encodeInstr(n); | ||
case "ModuleExport": | ||
@@ -28,0 +31,0 @@ // $FlowIgnore: SectionMetadata ensure that the node is well formated |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15658
418
+ Added@webassemblyjs/ast@1.1.2-y.5(transitive)
+ Added@webassemblyjs/helper-leb128@1.1.2-y.5(transitive)
+ Added@webassemblyjs/helper-wasm-bytecode@1.1.2-y.5(transitive)
+ Added@webassemblyjs/wasm-parser@1.1.2-y.5(transitive)
+ Added@webassemblyjs/wast-parser@1.1.2-y.5(transitive)
+ Addedwebassemblyjs@1.1.2-y.5(transitive)
- Removed@webassemblyjs/ast@1.1.2-y.4(transitive)
- Removed@webassemblyjs/helper-leb128@1.1.2-y.4(transitive)
- Removed@webassemblyjs/helper-wasm-bytecode@1.1.2-y.4(transitive)
- Removed@webassemblyjs/wasm-parser@1.1.2-y.4(transitive)
- Removed@webassemblyjs/wast-parser@1.1.2-y.4(transitive)
- Removedwebassemblyjs@1.1.2-y.4(transitive)
Updated@webassemblyjs/ast@1.1.2-y.5