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