Commit e797e0ea authored by titzer's avatar titzer Committed by Commit bot

[wasm] Add test for reexport of the same import twice.

R=clemensh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2592563003
Cr-Commit-Position: refs/heads/master@{#41850}
parent cbd3b3d0
...@@ -133,3 +133,44 @@ load("test/mjsunit/wasm/wasm-module-builder.js"); ...@@ -133,3 +133,44 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
assertSame(e.a, e.c); assertSame(e.a, e.c);
assertEquals(String(f.index), e.a.name); 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);
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment