Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Unified Diff: test/mjsunit/wasm/wasm-module-builder.js

Issue 2421453002: [wasm] Implement {Compile,Runtime}Error; fix traps from start function (Closed)
Patch Set: Fix merge artefact Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/wasm/wasm-constants.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/wasm-module-builder.js
diff --git a/test/mjsunit/wasm/wasm-module-builder.js b/test/mjsunit/wasm/wasm-module-builder.js
index df6007b67a73f9c55ddcf6f08af2f803f1cf0a69..94ecebe4684d38b1ee98e4424218d83041c0523f 100644
--- a/test/mjsunit/wasm/wasm-module-builder.js
+++ b/test/mjsunit/wasm/wasm-module-builder.js
@@ -83,6 +83,7 @@ class WasmFunctionBuilder {
this.module = module;
this.name = name;
this.type_index = type_index;
+ this.body = [];
}
exportAs(name) {
@@ -104,6 +105,10 @@ class WasmFunctionBuilder {
this.locals = locals;
return this;
}
+
+ end() {
+ return this.module;
+ }
}
class WasmGlobalBuilder {
@@ -138,6 +143,7 @@ class WasmModuleBuilder {
addStart(start_index) {
this.start_index = start_index;
+ return this;
}
addMemory(min, max, exp) {
@@ -197,6 +203,7 @@ class WasmModuleBuilder {
addImportedMemory(module, name, initial = 0, maximum) {
let o = {module: module, name: name, kind: kExternalMemory, initial: initial, maximum: maximum};
this.imports.push(o);
+ return this;
}
addDataSegment(addr, data, is_global = false) {
@@ -213,7 +220,7 @@ class WasmModuleBuilder {
return this;
}
- toArray(debug) {
+ toArray(debug = false) {
let binary = new Binary;
let wasm = this;
@@ -483,7 +490,7 @@ class WasmModuleBuilder {
return binary;
}
- toBuffer(debug) {
+ toBuffer(debug = false) {
let bytes = this.toArray(debug);
let buffer = new ArrayBuffer(bytes.length);
let view = new Uint8Array(buffer);
« no previous file with comments | « test/mjsunit/wasm/wasm-constants.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698