@webassemblyjs/helper-compiler
Advanced tools
Comparing version 1.11.1 to 1.11.3
@@ -1,2 +0,2 @@ | ||
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 _typeof(obj) { "@babel/helpers - typeof"; 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); } | ||
@@ -9,3 +9,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
import { getEndBlockByteOffset, getEndByteOffset, getFunctionBeginingByteOffset, getStartBlockByteOffset, getStartByteOffset, internalBrUnless, internalGoto, internalCallExtern, isBlock, isLoopInstruction, isCallInstruction, isFuncImportDescr, isIdentifier, isIfInstruction, isNumberLiteral, internalEndAndReturn, traverse } from "@webassemblyjs/ast"; | ||
import { getEndBlockByteOffset, getEndByteOffset, getFunctionBeginingByteOffset, getStartBlockByteOffset, getStartByteOffset, internalBrUnless, internalGoto, internalCallExtern, isBlock, isLoopInstruction, isCallInstruction, isFuncImportDescr, isIdentifier, isIfInstruction, isNumberLiteral, internalEndAndReturn, traverse } from "@webassemblyjs/ast"; // $FlowIgnore | ||
export var kStart = Symbol("_start"); | ||
@@ -55,5 +56,3 @@ | ||
export var Module = | ||
/*#__PURE__*/ | ||
function () { | ||
export var Module = /*#__PURE__*/function () { | ||
function Module(ast) { | ||
@@ -60,0 +59,0 @@ _classCallCheck(this, Module); |
@@ -1,2 +0,2 @@ | ||
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 _typeof(obj) { "@babel/helpers - typeof"; 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); } | ||
@@ -3,0 +3,0 @@ import { kStart } from "./index"; |
@@ -31,2 +31,3 @@ "use strict"; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _printer[key]) return; | ||
Object.defineProperty(exports, key, { | ||
@@ -33,0 +34,0 @@ enumerable: true, |
@@ -10,3 +10,3 @@ "use strict"; | ||
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 _typeof(obj) { "@babel/helpers - typeof"; 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); } | ||
@@ -19,2 +19,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
// $FlowIgnore | ||
var kStart = Symbol("_start"); | ||
@@ -65,5 +66,3 @@ exports.kStart = kStart; | ||
var Module = | ||
/*#__PURE__*/ | ||
function () { | ||
var Module = /*#__PURE__*/function () { | ||
function Module(ast) { | ||
@@ -70,0 +69,0 @@ _classCallCheck(this, Module); |
@@ -10,3 +10,3 @@ "use strict"; | ||
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 _typeof(obj) { "@babel/helpers - typeof"; 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); } | ||
@@ -13,0 +13,0 @@ function printInstruction(instruction) { |
{ | ||
"name": "@webassemblyjs/helper-compiler", | ||
"version": "1.11.1", | ||
"version": "1.11.3", | ||
"description": "", | ||
@@ -15,8 +15,8 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@webassemblyjs/ast": "1.11.1", | ||
"@webassemblyjs/helper-flatten-ast": "1.11.1" | ||
"@webassemblyjs/ast": "1.11.3", | ||
"@webassemblyjs/helper-flatten-ast": "1.11.3" | ||
}, | ||
"devDependencies": { | ||
"@webassemblyjs/helper-test-framework": "1.11.1", | ||
"@webassemblyjs/wasm-parser": "1.11.1", | ||
"@webassemblyjs/helper-test-framework": "1.11.3", | ||
"@webassemblyjs/wasm-parser": "1.11.3", | ||
"mamacro": "0.0.7", | ||
@@ -30,3 +30,3 @@ "wabt": "1.0.0-nightly.20180421" | ||
"license": "MIT", | ||
"gitHead": "3f07e2db2031afe0ce686630418c542938c1674b" | ||
"gitHead": "5fd2425602b752576bbe8089c343d5d70ebc861c" | ||
} |
@@ -7,3 +7,3 @@ // @flow | ||
func, | ||
program as tProgram | ||
program as tProgram, | ||
} from "@webassemblyjs/ast"; | ||
@@ -41,3 +41,3 @@ import { flatten } from "@webassemblyjs/helper-flatten-ast"; | ||
module.onFuncInstruction(path.node); | ||
} | ||
}, | ||
}); | ||
@@ -51,6 +51,6 @@ | ||
instructions.forEach(instruction => { | ||
instructions.forEach((instruction) => { | ||
program[instruction.offset] = instruction.node; | ||
}); | ||
} | ||
}, | ||
}); | ||
@@ -61,3 +61,3 @@ | ||
funcTable, | ||
program | ||
program, | ||
}; | ||
@@ -75,3 +75,3 @@ } | ||
instrs.forEach(i => module.onFuncInstruction(i)); | ||
instrs.forEach((i) => module.onFuncInstruction(i)); | ||
@@ -82,3 +82,3 @@ const { name, instructions, startAt } = module.finalizeFunc(fakeFunc); | ||
instructions.forEach(instruction => { | ||
instructions.forEach((instruction) => { | ||
program[instruction.offset] = instruction.node; | ||
@@ -90,3 +90,3 @@ }); | ||
funcTable, | ||
program | ||
program, | ||
}; | ||
@@ -93,0 +93,0 @@ } |
@@ -21,5 +21,6 @@ // @flow | ||
internalEndAndReturn, | ||
traverse | ||
traverse, | ||
} from "@webassemblyjs/ast"; | ||
// $FlowIgnore | ||
export const kStart = Symbol("_start"); | ||
@@ -30,9 +31,15 @@ | ||
define(LABEL_POP, () => ` | ||
define( | ||
LABEL_POP, | ||
() => ` | ||
this._labels.pop(); | ||
`); | ||
` | ||
); | ||
define(LABEL_PUSH, node => ` | ||
define( | ||
LABEL_PUSH, | ||
(node) => ` | ||
this._labels.push(${node}); | ||
`); | ||
` | ||
); | ||
@@ -45,3 +52,3 @@ /** | ||
type Context = { | ||
funcs: Array<{ node?: Func, isImplemented: boolean }> | ||
funcs: Array<{ node?: Func, isImplemented: boolean }>, | ||
}; | ||
@@ -51,3 +58,3 @@ | ||
const context = { | ||
funcs: [] | ||
funcs: [], | ||
}; | ||
@@ -59,3 +66,3 @@ | ||
context.funcs.push({ | ||
isImplemented: false | ||
isImplemented: false, | ||
}); | ||
@@ -68,5 +75,5 @@ } | ||
isImplemented: true, | ||
node: path.node | ||
node: path.node, | ||
}); | ||
} | ||
}, | ||
}); | ||
@@ -180,3 +187,3 @@ | ||
// $FlowIgnore | ||
node.consequent.forEach(n => this._emit(n)); | ||
node.consequent.forEach((n) => this._emit(n)); | ||
@@ -197,4 +204,4 @@ // Skipping the alternate once the consequent block has been executed. | ||
// $FlowIgnore | ||
column: node.alternate[0].loc.start.column - 1 | ||
} | ||
column: node.alternate[0].loc.start.column - 1, | ||
}, | ||
}; | ||
@@ -205,3 +212,3 @@ | ||
// $FlowIgnore | ||
node.alternate.forEach(n => this._emit(n)); | ||
node.alternate.forEach((n) => this._emit(n)); | ||
@@ -214,3 +221,3 @@ return; | ||
emitStartFunc(index: number) { | ||
emitStartFunc(index: number): any { | ||
const funcInContext = this._context.funcs[index]; | ||
@@ -224,7 +231,7 @@ assert(typeof funcInContext === "object"); | ||
name: kStart, | ||
startAt: getFunctionBeginingByteOffset(func) | ||
startAt: getFunctionBeginingByteOffset(func), | ||
}; | ||
} | ||
finalizeFunc(func: Func) { | ||
finalizeFunc(func: Func): any { | ||
LABEL_POP(); | ||
@@ -247,5 +254,5 @@ | ||
startAt: getFunctionBeginingByteOffset(func), | ||
instructions: this._program | ||
instructions: this._program, | ||
}; | ||
} | ||
} |
@@ -44,3 +44,3 @@ // @flow | ||
// $FlowIgnore | ||
instruction.args.forEach(arg => { | ||
instruction.args.forEach((arg) => { | ||
out += " "; | ||
@@ -65,3 +65,3 @@ // $FlowIgnore | ||
ir.funcTable.forEach(func => { | ||
ir.funcTable.forEach((func) => { | ||
if (func.name === kStart) { | ||
@@ -68,0 +68,0 @@ out += "__start" + " at " + func.startAt + "\n"; |
@@ -5,3 +5,3 @@ const { decode } = require("@webassemblyjs/wasm-parser"); | ||
getFixtures, | ||
compareWithExpected | ||
compareWithExpected, | ||
} = require("@webassemblyjs/helper-test-framework"); | ||
@@ -8,0 +8,0 @@ |
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
40793
1081
+ Added@webassemblyjs/ast@1.11.3(transitive)
+ Added@webassemblyjs/helper-flatten-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-flatten-ast@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