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

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

Issue 1780483002: [wasm] Support a two-level namespace for imports. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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/cctest/wasm/test-run-wasm-js.cc ('k') | test/mjsunit/wasm/wasm-module-builder.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/test-wasm-module-builder.js
diff --git a/test/mjsunit/wasm/test-wasm-module-builder.js b/test/mjsunit/wasm/test-wasm-module-builder.js
index e68e375f54fb66470122b6b56f61facf46779e4e..8103d7b9bad457a8d0fccca5d39dd56d71096878 100644
--- a/test/mjsunit/wasm/test-wasm-module-builder.js
+++ b/test/mjsunit/wasm/test-wasm-module-builder.js
@@ -138,3 +138,16 @@ var debug = false;
var instance = Wasm.instantiateModule(array2);
assertEquals(17, instance.exports.blarg());
})();
+
+(function ImportTestTwoLevel() {
+ var module = new WasmModuleBuilder();
+ var index = module.addImportWithModule("mod", "print", [kAstStmt, kAstI32]);
+ module.addFunction("foo", [kAstStmt])
+ .addBody([kExprCallImport, index, kExprI8Const, 19])
+ .exportAs("main");
+
+ var buffer = module.toBuffer(debug);
+ var instance = Wasm.instantiateModule(buffer, {mod: {print: print}});
+ print("should print 19! ");
+ instance.exports.main();
+})();
« no previous file with comments | « test/cctest/wasm/test-run-wasm-js.cc ('k') | test/mjsunit/wasm/wasm-module-builder.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698