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

Unified Diff: test/mjsunit/wasm/export-table.js

Issue 2443353002: [wasm] Add support for exporting WebAssembly.Table instances. (Closed)
Patch Set: Fix identity of exported JSFunctions 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 | « src/wasm/wasm-module.cc ('k') | test/mjsunit/wasm/indirect-calls.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/export-table.js
diff --git a/test/mjsunit/wasm/export-table.js b/test/mjsunit/wasm/export-table.js
index 89e0b4436dd5e8764b80de79bff599395a8c6bb9..4e9f1314e30457baf50bfc26232be116e83dbcfd 100644
--- a/test/mjsunit/wasm/export-table.js
+++ b/test/mjsunit/wasm/export-table.js
@@ -8,6 +8,7 @@ load("test/mjsunit/wasm/wasm-constants.js");
load("test/mjsunit/wasm/wasm-module-builder.js");
(function testExportedMain() {
+ print("TestExportedMain...");
var kReturnValue = 88;
var builder = new WasmModuleBuilder();
@@ -28,6 +29,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
})();
(function testExportedTwice() {
+ print("TestExportedTwice...");
var kReturnValue = 99;
var builder = new WasmModuleBuilder();
@@ -49,10 +51,12 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
assertEquals(kReturnValue, module.exports.foo());
assertEquals(kReturnValue, module.exports.blah());
+ assertSame(module.exports.blah, module.exports.foo);
})();
(function testNumericName() {
+ print("TestNumericName...");
var kReturnValue = 93;
var builder = new WasmModuleBuilder();
@@ -74,6 +78,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
})();
(function testExportNameClash() {
+ print("TestExportNameClash...");
var builder = new WasmModuleBuilder();
builder.addFunction("one", kSig_v_v).addBody([kExprNop]).exportAs("main");
@@ -87,3 +92,23 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
assertContains("Duplicate export", e.toString());
}
})();
+
+
+(function testExportMultipleIdentity() {
+ print("TestExportMultipleIdentity...");
+ var builder = new WasmModuleBuilder();
+
+ builder.addFunction("one", kSig_v_v).addBody([kExprNop])
+ .exportAs("a")
+ .exportAs("b")
+ .exportAs("c");
+
+ let instance = builder.instantiate();
+ let e = instance.exports;
+ assertEquals("function", typeof e.a);
+ assertEquals("function", typeof e.b);
+ assertEquals("function", typeof e.c);
+ assertSame(e.a, e.b);
+ assertSame(e.a, e.c);
+ assertEquals("a", e.a.name);
+})();
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | test/mjsunit/wasm/indirect-calls.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698