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

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

Issue 2592563003: [wasm] Add test for reexport of the same import twice. (Closed)
Patch Set: Added test for second case. Created 4 years 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 | « no previous file | no next file » | 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 2200af5c68f9df3b6c6a88844de1dbdae6fc5990..f715b20f1f049b33f19046624c4c0ed0c2bc1190 100644
--- a/test/mjsunit/wasm/export-table.js
+++ b/test/mjsunit/wasm/export-table.js
@@ -133,3 +133,44 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
assertSame(e.a, e.c);
assertEquals(String(f.index), e.a.name);
})();
+
+
+(function testReexportJSMultipleIdentity() {
+ print("TestReexportMultipleIdentity...");
+ var builder = new WasmModuleBuilder();
+
+ function js() {}
+
+ var a = builder.addImport("a", kSig_v_v);
+ builder.addExport("f", a);
+ builder.addExport("g", a);
+
+ let instance = builder.instantiate({a: js});
+ let e = instance.exports;
+ assertEquals("function", typeof e.f);
+ assertEquals("function", typeof e.g);
+ assertFalse(e.f == js);
+ assertFalse(e.g == js);
+ assertTrue(e.f == e.g);
+})();
+
+
+(function testReexportJSMultiple() {
+ print("TestReexportMultiple...");
+ var builder = new WasmModuleBuilder();
+
+ function js() {}
+
+ var a = builder.addImport("a", kSig_v_v);
+ var b = builder.addImport("b", kSig_v_v);
+ builder.addExport("f", a);
+ builder.addExport("g", b);
+
+ let instance = builder.instantiate({a: js, b: js});
+ let e = instance.exports;
+ assertEquals("function", typeof e.f);
+ assertEquals("function", typeof e.g);
+ assertFalse(e.f == js);
+ assertFalse(e.g == js);
+ assertFalse(e.f == e.g);
+})();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698