@webassemblyjs/wasm-edit
Advanced tools
Comparing version 1.7.0-0 to 1.7.0-1
@@ -12,4 +12,2 @@ 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; } | ||
var debug = require("debug")("webassemblyjs:wasm"); | ||
function shiftLocNodeByDelta(node, delta) { | ||
@@ -60,4 +58,3 @@ assertHasLoc(node); // $FlowIgnore: assertHasLoc ensures that | ||
var newValue = node.metadata.bodySize + bodySizeDeltaBytes; | ||
var newByteArray = encodeU32(newValue); | ||
debug("resize func body newValue=%d", newValue); // function body size byte | ||
var newByteArray = encodeU32(newValue); // function body size byte | ||
// FIXME(sven): only handles one byte u32 | ||
@@ -174,3 +171,2 @@ | ||
var deltaBytes = newByteArray.length; | ||
debug("add node=%s section=%s after=%d deltaBytes=%s deltaElements=%s", node.type, sectionName, start, deltaBytes, deltaElements); | ||
uint8Buffer = overrideBytesInBuffer(uint8Buffer, start, end, newByteArray); | ||
@@ -177,0 +173,0 @@ node.loc = { |
@@ -5,3 +5,5 @@ import { decode } from "@webassemblyjs/wasm-parser"; | ||
import { shrinkPaddedLEB128 } from "@webassemblyjs/wasm-opt"; | ||
import constants from "@webassemblyjs/helper-wasm-bytecode"; | ||
var constants = require("@webassemblyjs/helper-wasm-bytecode"); | ||
import { applyOperations } from "./apply"; | ||
@@ -8,0 +10,0 @@ |
@@ -24,4 +24,2 @@ "use strict"; | ||
var debug = require("debug")("webassemblyjs:wasm"); | ||
function shiftLocNodeByDelta(node, delta) { | ||
@@ -72,4 +70,3 @@ (0, _ast.assertHasLoc)(node); // $FlowIgnore: assertHasLoc ensures that | ||
var newValue = node.metadata.bodySize + bodySizeDeltaBytes; | ||
var newByteArray = (0, _encoder.encodeU32)(newValue); | ||
debug("resize func body newValue=%d", newValue); // function body size byte | ||
var newByteArray = (0, _encoder.encodeU32)(newValue); // function body size byte | ||
// FIXME(sven): only handles one byte u32 | ||
@@ -186,3 +183,2 @@ | ||
var deltaBytes = newByteArray.length; | ||
debug("add node=%s section=%s after=%d deltaBytes=%s deltaElements=%s", node.type, sectionName, start, deltaBytes, deltaElements); | ||
uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newByteArray); | ||
@@ -189,0 +185,0 @@ node.loc = { |
@@ -19,7 +19,5 @@ "use strict"; | ||
var _helperWasmBytecode = _interopRequireDefault(require("@webassemblyjs/helper-wasm-bytecode")); | ||
var _apply = require("./apply"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var constants = require("@webassemblyjs/helper-wasm-bytecode"); | ||
@@ -37,9 +35,7 @@ function hashNode(node) { | ||
nodes.sort(function (a, b) { | ||
var sectionA = _helperWasmBytecode.default.getSectionForNode(a); | ||
var sectionA = constants.getSectionForNode(a); | ||
var sectionB = constants.getSectionForNode(b); | ||
var aId = constants.sections[sectionA]; | ||
var bId = constants.sections[sectionB]; | ||
var sectionB = _helperWasmBytecode.default.getSectionForNode(b); | ||
var aId = _helperWasmBytecode.default.sections[sectionA]; | ||
var bId = _helperWasmBytecode.default.sections[sectionB]; | ||
if (typeof aId !== "number" || typeof bId !== "number") { | ||
@@ -46,0 +42,0 @@ throw new Error("Section id not found"); |
{ | ||
"name": "@webassemblyjs/wasm-edit", | ||
"version": "1.7.0-0", | ||
"version": "1.7.0-1", | ||
"description": "", | ||
@@ -20,15 +20,14 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@webassemblyjs/ast": "1.7.0-0", | ||
"@webassemblyjs/helper-buffer": "1.7.0-0", | ||
"@webassemblyjs/helper-wasm-bytecode": "1.7.0-0", | ||
"@webassemblyjs/helper-wasm-section": "1.7.0-0", | ||
"@webassemblyjs/wasm-gen": "1.7.0-0", | ||
"@webassemblyjs/wasm-opt": "1.7.0-0", | ||
"@webassemblyjs/wasm-parser": "1.7.0-0", | ||
"@webassemblyjs/wast-printer": "1.7.0-0", | ||
"debug": "^3.1.0" | ||
"@webassemblyjs/ast": "1.7.0-1", | ||
"@webassemblyjs/helper-buffer": "1.7.0-1", | ||
"@webassemblyjs/helper-wasm-bytecode": "1.7.0-1", | ||
"@webassemblyjs/helper-wasm-section": "1.7.0-1", | ||
"@webassemblyjs/wasm-gen": "1.7.0-1", | ||
"@webassemblyjs/wasm-opt": "1.7.0-1", | ||
"@webassemblyjs/wasm-parser": "1.7.0-1", | ||
"@webassemblyjs/wast-printer": "1.7.0-1" | ||
}, | ||
"devDependencies": { | ||
"@webassemblyjs/helper-test-framework": "1.7.0-0" | ||
"@webassemblyjs/helper-test-framework": "1.7.0-1" | ||
} | ||
} |
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
8
25045
609
0
+ Added@webassemblyjs/ast@1.7.0-1(transitive)
+ Added@webassemblyjs/floating-point-hex-parser@1.7.0-1(transitive)
+ Added@webassemblyjs/helper-api-error@1.7.0-1(transitive)
+ Added@webassemblyjs/helper-buffer@1.7.0-1(transitive)
+ Added@webassemblyjs/helper-code-frame@1.7.0-1(transitive)
+ Added@webassemblyjs/helper-fsm@1.7.0-1(transitive)
+ Added@webassemblyjs/helper-module-context@1.7.0-1(transitive)
+ Added@webassemblyjs/helper-wasm-bytecode@1.7.0-1(transitive)
+ Added@webassemblyjs/helper-wasm-section@1.7.0-1(transitive)
+ Added@webassemblyjs/ieee754@1.7.0-1(transitive)
+ Added@webassemblyjs/leb128@1.7.0-1(transitive)
+ Added@webassemblyjs/utf8@1.7.0-1(transitive)
+ Added@webassemblyjs/wasm-gen@1.7.0-1(transitive)
+ Added@webassemblyjs/wasm-opt@1.7.0-1(transitive)
+ Added@webassemblyjs/wasm-parser@1.7.0-1(transitive)
+ Added@webassemblyjs/wast-parser@1.7.0-1(transitive)
+ Added@webassemblyjs/wast-printer@1.7.0-1(transitive)
- Removeddebug@^3.1.0
- Removed@webassemblyjs/ast@1.7.0-0(transitive)
- Removed@webassemblyjs/floating-point-hex-parser@1.7.0-0(transitive)
- Removed@webassemblyjs/helper-api-error@1.7.0-0(transitive)
- Removed@webassemblyjs/helper-buffer@1.7.0-0(transitive)
- Removed@webassemblyjs/helper-code-frame@1.7.0-0(transitive)
- Removed@webassemblyjs/helper-fsm@1.7.0-0(transitive)
- Removed@webassemblyjs/helper-module-context@1.7.0-0(transitive)
- Removed@webassemblyjs/helper-wasm-bytecode@1.7.0-0(transitive)
- Removed@webassemblyjs/helper-wasm-section@1.7.0-0(transitive)
- Removed@webassemblyjs/ieee754@1.7.0-0(transitive)
- Removed@webassemblyjs/leb128@1.7.0-0(transitive)
- Removed@webassemblyjs/utf8@1.7.0-0(transitive)
- Removed@webassemblyjs/wasm-gen@1.7.0-0(transitive)
- Removed@webassemblyjs/wasm-opt@1.7.0-0(transitive)
- Removed@webassemblyjs/wasm-parser@1.7.0-0(transitive)
- Removed@webassemblyjs/wast-parser@1.7.0-0(transitive)
- Removed@webassemblyjs/wast-printer@1.7.0-0(transitive)
- Removeddebug@3.2.7(transitive)
- Removedms@2.1.3(transitive)
Updated@webassemblyjs/ast@1.7.0-1