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()); |
+ } |
+})(); |