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

Side by Side Diff: test/mjsunit/wasm/export-table.js

Issue 2592563003: [wasm] Add test for reexport of the same import twice. (Closed)
Patch Set: Added test for second case. Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 builder.addExport("f", a);
146 builder.addExport("g", a);
147
148 let instance = builder.instantiate({a: js});
149 let e = instance.exports;
150 assertEquals("function", typeof e.f);
151 assertEquals("function", typeof e.g);
152 assertFalse(e.f == js);
153 assertFalse(e.g == js);
154 assertTrue(e.f == e.g);
155 })();
156
157
158 (function testReexportJSMultiple() {
159 print("TestReexportMultiple...");
160 var builder = new WasmModuleBuilder();
161
162 function js() {}
163
164 var a = builder.addImport("a", kSig_v_v);
165 var b = builder.addImport("b", kSig_v_v);
166 builder.addExport("f", a);
167 builder.addExport("g", b);
168
169 let instance = builder.instantiate({a: js, b: js});
170 let e = instance.exports;
171 assertEquals("function", typeof e.f);
172 assertEquals("function", typeof e.g);
173 assertFalse(e.f == js);
174 assertFalse(e.g == js);
175 assertFalse(e.f == e.g);
176 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698