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

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

Issue 2084573002: Upgrade Wasm JS API, step 1 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Separate test refactorings Created 4 years, 6 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
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 bfc4460d91b899d4ca640502cbfd625ef35ea1b4..992aef243709532b33e8bb23c555892c4f0b78ef 100644
--- a/test/mjsunit/wasm/wasm-module-builder.js
+++ b/test/mjsunit/wasm/wasm-module-builder.js
@@ -342,11 +342,8 @@ WasmModuleBuilder.prototype.toBuffer = function(debug) {
return buffer;
}
-WasmModuleBuilder.prototype.instantiate = function(ffi, memory) {
- var buffer = this.toBuffer();
- if (memory != undefined) {
- return Wasm.instantiateModule(buffer, ffi, memory);
- } else {
- return Wasm.instantiateModule(buffer, ffi);
- }
+WasmModuleBuilder.prototype.instantiate = function(...args) {
+ var module = new WebAssembly.Module(this.toBuffer());
+ var instance = new WebAssembly.Instance(module, ...args);
+ return instance;
}

Powered by Google App Engine
This is Rietveld 408576698