| 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);
|
|
|