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

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: Address ahaas' comments 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
« no previous file with comments | « 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..2084ddfc0aa8a5a0dff0b5e9b10a4fbb9a3ab444 100644
--- a/test/mjsunit/wasm/export-table.js
+++ b/test/mjsunit/wasm/export-table.js
@@ -72,3 +72,18 @@ 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");
+ builder.addFunction("two", kSig_v_v).addBody([kExprNop]).exportAs("other");
+ builder.addFunction("three", kSig_v_v).addBody([kExprNop]).exportAs("main");
+
+ try {
+ builder.instantiate();
+ assertUnreachable("should have thrown an exception");
+ } catch (e) {
+ assertContains("Duplicate export", e.toString());
+ }
+})();
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698