@webassemblyjs/wasm-edit
Advanced tools
Comparing version 1.7.9 to 1.7.10
@@ -19,2 +19,27 @@ import { decode } from "@webassemblyjs/wasm-parser"; | ||
function sortBySectionOrder(nodes) { | ||
var originalOrder = new Map(); | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
try { | ||
for (var _iterator = nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var _node = _step.value; | ||
originalOrder.set(_node, originalOrder.size); | ||
} | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator.return != null) { | ||
_iterator.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
} | ||
nodes.sort(function (a, b) { | ||
@@ -30,2 +55,7 @@ var sectionA = getSectionForNode(a); | ||
if (aId === bId) { | ||
// $FlowIgnore originalOrder is filled for all nodes | ||
return originalOrder.get(a) - originalOrder.get(b); | ||
} | ||
return aId - bId; | ||
@@ -32,0 +62,0 @@ }); |
@@ -35,2 +35,27 @@ "use strict"; | ||
function sortBySectionOrder(nodes) { | ||
var originalOrder = new Map(); | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
try { | ||
for (var _iterator = nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var _node = _step.value; | ||
originalOrder.set(_node, originalOrder.size); | ||
} | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator.return != null) { | ||
_iterator.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
} | ||
nodes.sort(function (a, b) { | ||
@@ -46,2 +71,7 @@ var sectionA = (0, _helperWasmBytecode.getSectionForNode)(a); | ||
if (aId === bId) { | ||
// $FlowIgnore originalOrder is filled for all nodes | ||
return originalOrder.get(a) - originalOrder.get(b); | ||
} | ||
return aId - bId; | ||
@@ -48,0 +78,0 @@ }); |
{ | ||
"name": "@webassemblyjs/wasm-edit", | ||
"version": "1.7.9", | ||
"version": "1.7.10", | ||
"description": "", | ||
@@ -20,15 +20,15 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@webassemblyjs/ast": "1.7.9", | ||
"@webassemblyjs/helper-buffer": "1.7.9", | ||
"@webassemblyjs/helper-wasm-bytecode": "1.7.9", | ||
"@webassemblyjs/helper-wasm-section": "1.7.9", | ||
"@webassemblyjs/wasm-gen": "1.7.9", | ||
"@webassemblyjs/wasm-opt": "1.7.9", | ||
"@webassemblyjs/wasm-parser": "1.7.9", | ||
"@webassemblyjs/wast-printer": "1.7.9" | ||
"@webassemblyjs/ast": "1.7.10", | ||
"@webassemblyjs/helper-buffer": "1.7.10", | ||
"@webassemblyjs/helper-wasm-bytecode": "1.7.10", | ||
"@webassemblyjs/helper-wasm-section": "1.7.10", | ||
"@webassemblyjs/wasm-gen": "1.7.10", | ||
"@webassemblyjs/wasm-opt": "1.7.10", | ||
"@webassemblyjs/wasm-parser": "1.7.10", | ||
"@webassemblyjs/wast-printer": "1.7.10" | ||
}, | ||
"devDependencies": { | ||
"@webassemblyjs/helper-test-framework": "1.7.9" | ||
"@webassemblyjs/helper-test-framework": "1.7.10" | ||
}, | ||
"gitHead": "6c5bd6e21d734967e12bb7b7aaa38c80697b3b68" | ||
"gitHead": "f558c6c047187f24a2200ab04104f173de226794" | ||
} |
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
32974
666
+ Added@webassemblyjs/ast@1.7.10(transitive)
+ Added@webassemblyjs/floating-point-hex-parser@1.7.10(transitive)
+ Added@webassemblyjs/helper-api-error@1.7.10(transitive)
+ Added@webassemblyjs/helper-buffer@1.7.10(transitive)
+ Added@webassemblyjs/helper-code-frame@1.7.10(transitive)
+ Added@webassemblyjs/helper-fsm@1.7.10(transitive)
+ Added@webassemblyjs/helper-module-context@1.7.10(transitive)
+ Added@webassemblyjs/helper-wasm-bytecode@1.7.10(transitive)
+ Added@webassemblyjs/helper-wasm-section@1.7.10(transitive)
+ Added@webassemblyjs/ieee754@1.7.10(transitive)
+ Added@webassemblyjs/leb128@1.7.10(transitive)
+ Added@webassemblyjs/utf8@1.7.10(transitive)
+ Added@webassemblyjs/wasm-gen@1.7.10(transitive)
+ Added@webassemblyjs/wasm-opt@1.7.10(transitive)
+ Added@webassemblyjs/wasm-parser@1.7.10(transitive)
+ Added@webassemblyjs/wast-parser@1.7.10(transitive)
+ Added@webassemblyjs/wast-printer@1.7.10(transitive)
- Removed@webassemblyjs/ast@1.7.9(transitive)
- Removed@webassemblyjs/floating-point-hex-parser@1.7.9(transitive)
- Removed@webassemblyjs/helper-api-error@1.7.9(transitive)
- Removed@webassemblyjs/helper-buffer@1.7.9(transitive)
- Removed@webassemblyjs/helper-code-frame@1.7.9(transitive)
- Removed@webassemblyjs/helper-fsm@1.7.9(transitive)
- Removed@webassemblyjs/helper-module-context@1.7.9(transitive)
- Removed@webassemblyjs/helper-wasm-bytecode@1.7.9(transitive)
- Removed@webassemblyjs/helper-wasm-section@1.7.9(transitive)
- Removed@webassemblyjs/ieee754@1.7.9(transitive)
- Removed@webassemblyjs/leb128@1.7.9(transitive)
- Removed@webassemblyjs/utf8@1.7.9(transitive)
- Removed@webassemblyjs/wasm-gen@1.7.9(transitive)
- Removed@webassemblyjs/wasm-opt@1.7.9(transitive)
- Removed@webassemblyjs/wasm-parser@1.7.9(transitive)
- Removed@webassemblyjs/wast-parser@1.7.9(transitive)
- Removed@webassemblyjs/wast-printer@1.7.9(transitive)
Updated@webassemblyjs/ast@1.7.10