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

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

Issue 2065043002: [wasm] Check for duplicate export names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: last change, saving one line :) 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
« src/wasm/module-decoder.cc ('K') | « src/wasm/module-decoder.cc ('k') | 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 a41d85dbc79c9480b745071275fae552a1a1c572..4e6429d688b993782b9486817bbbc26c226539a2 100644
--- a/test/mjsunit/wasm/export-table.js
+++ b/test/mjsunit/wasm/export-table.js
@@ -72,3 +72,22 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
assertEquals(kReturnValue, module.exports["0"]());
})();
+
+(function testExportNameClash() {
+ var builder = new WasmModuleBuilder();
+
+ builder.addFunction("one", kSig_v_v)
+ .addBody([kExprNop])
+ .exportAs("main");
+
ahaas 2016/06/16 09:16:13 nit: Add an additional function in between to make
Clemens Hammacher 2016/06/16 12:16:10 Done.
+ builder.addFunction("two", kSig_v_v)
+ .addBody([kExprNop])
+ .exportAs("main");
+
+ try {
+ builder.instantiate();
+ assertUnreachable("should have thrown an exception");
+ } catch (e) {
+ assertContains("Duplicate export", e.toString());
+ }
+})();
« src/wasm/module-decoder.cc ('K') | « src/wasm/module-decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698