@webassemblyjs/helper-flatten-ast
Advanced tools
Comparing version 1.11.1 to 1.11.3
@@ -1,3 +0,13 @@ | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
import { traverse, isInstruction } from "@webassemblyjs/ast"; | ||
@@ -44,3 +54,3 @@ export function flatten(ast) { | ||
if (isInstruction(arg) === false) { | ||
return _toConsumableArray(acc).concat([arg]); | ||
return [].concat(_toConsumableArray(acc), [arg]); | ||
} | ||
@@ -47,0 +57,0 @@ |
@@ -10,4 +10,14 @@ "use strict"; | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function flatten(ast) { | ||
@@ -53,3 +63,3 @@ /** | ||
if ((0, _ast.isInstruction)(arg) === false) { | ||
return _toConsumableArray(acc).concat([arg]); | ||
return [].concat(_toConsumableArray(acc), [arg]); | ||
} | ||
@@ -56,0 +66,0 @@ |
{ | ||
"name": "@webassemblyjs/helper-flatten-ast", | ||
"version": "1.11.1", | ||
"version": "1.11.3", | ||
"description": "Flatten an AST helper", | ||
@@ -17,10 +17,10 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@webassemblyjs/ast": "1.11.1" | ||
"@webassemblyjs/ast": "1.11.3" | ||
}, | ||
"devDependencies": { | ||
"@webassemblyjs/helper-test-framework": "1.11.1", | ||
"@webassemblyjs/wast-parser": "1.11.1", | ||
"@webassemblyjs/wast-printer": "1.11.1" | ||
"@webassemblyjs/helper-test-framework": "1.11.3", | ||
"@webassemblyjs/wast-parser": "1.11.3", | ||
"@webassemblyjs/wast-printer": "1.11.3" | ||
}, | ||
"gitHead": "3f07e2db2031afe0ce686630418c542938c1674b" | ||
"gitHead": "5fd2425602b752576bbe8089c343d5d70ebc861c" | ||
} |
@@ -64,3 +64,3 @@ // @flow | ||
CallInstruction: CallInstructionVisitor, | ||
Instr: InstrVisitor | ||
Instr: InstrVisitor, | ||
}); | ||
@@ -67,0 +67,0 @@ } |
@@ -5,3 +5,3 @@ const { parse } = require("@webassemblyjs/wast-parser"); | ||
getFixtures, | ||
compareWithExpected | ||
compareWithExpected, | ||
} = require("@webassemblyjs/helper-test-framework"); | ||
@@ -13,5 +13,5 @@ | ||
const testSuites = getFixtures(__dirname, "fixtures", "**/actual.wast"); | ||
const pre = f => print(flatten(parse(f))); | ||
const pre = (f) => print(flatten(parse(f))); | ||
compareWithExpected(testSuites, pre, "expected.wast"); | ||
}); |
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
9350
191
+ Added@webassemblyjs/ast@1.11.3(transitive)
- Removed@webassemblyjs/ast@1.11.1(transitive)
- Removed@webassemblyjs/floating-point-hex-parser@1.11.1(transitive)
- Removed@webassemblyjs/helper-api-error@1.11.1(transitive)
- Removed@webassemblyjs/helper-numbers@1.11.1(transitive)
- Removed@webassemblyjs/helper-wasm-bytecode@1.11.1(transitive)
- Removed@xtuc/long@4.2.2(transitive)
Updated@webassemblyjs/ast@1.11.3