OLD | NEW |
---|---|
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --expose-wasm | 5 // Flags: --expose-wasm |
6 | 6 |
7 load("test/mjsunit/wasm/wasm-constants.js"); | 7 load("test/mjsunit/wasm/wasm-constants.js"); |
8 load("test/mjsunit/wasm/wasm-module-builder.js"); | 8 load("test/mjsunit/wasm/wasm-module-builder.js"); |
9 | 9 |
10 (function testExportedMain() { | 10 (function testExportedMain() { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 | 126 |
127 let instance = builder.instantiate(); | 127 let instance = builder.instantiate(); |
128 let e = instance.exports; | 128 let e = instance.exports; |
129 assertEquals("function", typeof e.a); | 129 assertEquals("function", typeof e.a); |
130 assertEquals("function", typeof e.b); | 130 assertEquals("function", typeof e.b); |
131 assertEquals("function", typeof e.c); | 131 assertEquals("function", typeof e.c); |
132 assertSame(e.a, e.b); | 132 assertSame(e.a, e.b); |
133 assertSame(e.a, e.c); | 133 assertSame(e.a, e.c); |
134 assertEquals(String(f.index), e.a.name); | 134 assertEquals(String(f.index), e.a.name); |
135 })(); | 135 })(); |
136 | |
137 | |
138 (function testReexportJSMultipleIdentity() { | |
139 print("TestReexportMultipleIdentity..."); | |
140 var builder = new WasmModuleBuilder(); | |
141 | |
142 function js() {} | |
143 | |
144 var a = builder.addImport("a", kSig_v_v); | |
145 var b = builder.addImport("a", kSig_v_v); | |
146 builder.addExport("f", a); | |
147 builder.addExport("g", b); | |
148 | |
149 let instance = builder.instantiate({a: js, b: js}); | |
Clemens Hammacher
2016/12/20 09:51:39
b is not needed here
titzer
2016/12/20 10:13:45
Actually that was a bug in the test. Good catch. F
| |
150 let e = instance.exports; | |
151 assertEquals("function", typeof e.f); | |
152 assertEquals("function", typeof e.g); | |
153 assertFalse(e.f == js); | |
154 assertFalse(e.g == js); | |
155 assertFalse(e.f == e.g); | |
156 })(); | |
OLD | NEW |