@webassemblyjs/helper-module-context
Advanced tools
Comparing version 1.5.10 to 1.5.11
@@ -28,2 +28,7 @@ "use strict"; | ||
switch (field.type) { | ||
case "Start": | ||
{ | ||
moduleContext.setStart(field.index); | ||
} | ||
case "Func": | ||
@@ -105,5 +110,6 @@ { | ||
this.debugName = "unknown"; | ||
this.start = null; | ||
} | ||
/** | ||
* Reset the active stack frame | ||
* Set start segment | ||
*/ | ||
@@ -113,2 +119,20 @@ | ||
_createClass(ModuleContext, [{ | ||
key: "setStart", | ||
value: function setStart(index) { | ||
this.start = index.value; | ||
} | ||
/** | ||
* Get start function | ||
*/ | ||
}, { | ||
key: "getStart", | ||
value: function getStart() { | ||
return this.start; | ||
} | ||
/** | ||
* Reset the active stack frame | ||
*/ | ||
}, { | ||
key: "newContext", | ||
@@ -132,7 +156,8 @@ value: function newContext(debugName, expectedResult) { | ||
// eslint-disable-next-line prefer-const | ||
var _func$signature = func.signature, | ||
_func$signature$param = _func$signature.params, | ||
args = _func$signature$param === void 0 ? [] : _func$signature$param, | ||
_func$signature$resul = _func$signature.results, | ||
result = _func$signature$resul === void 0 ? [] : _func$signature$resul; | ||
var _ref = func.signature || {}, | ||
_ref$params = _ref.params, | ||
args = _ref$params === void 0 ? [] : _ref$params, | ||
_ref$results = _ref.results, | ||
result = _ref$results === void 0 ? [] : _ref$results; | ||
args = args.map(function (arg) { | ||
@@ -139,0 +164,0 @@ return arg.valtype; |
{ | ||
"name": "@webassemblyjs/helper-module-context", | ||
"version": "1.5.10", | ||
"version": "1.5.11", | ||
"description": "", | ||
@@ -16,2 +16,5 @@ "main": "lib/index.js", | ||
}, | ||
"devDependencies": { | ||
"@webassemblyjs/wast-parser": "1.5.11" | ||
}, | ||
"publishConfig": { | ||
@@ -18,0 +21,0 @@ "access": "public" |
@@ -14,2 +14,5 @@ // TODO(sven): add flow in here | ||
switch (field.type) { | ||
case "Start": { | ||
moduleContext.setStart(field.index); | ||
} | ||
case "Func": { | ||
@@ -83,5 +86,21 @@ moduleContext.addFunction(field); | ||
this.debugName = "unknown"; | ||
this.start = null; | ||
} | ||
/** | ||
* Set start segment | ||
*/ | ||
setStart(index) { | ||
this.start = index.value; | ||
} | ||
/** | ||
* Get start function | ||
*/ | ||
getStart() { | ||
return this.start; | ||
} | ||
/** | ||
* Reset the active stack frame | ||
@@ -103,3 +122,3 @@ */ | ||
// eslint-disable-next-line prefer-const | ||
let { params: args = [], results: result = [] } = func.signature; | ||
let { params: args = [], results: result = [] } = func.signature || {}; | ||
@@ -106,0 +125,0 @@ args = args.map(arg => arg.valtype); |
15219
4
532
1