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

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

Issue 2591753002: [wasm] Implement correct 2-level namespace for imports. (Closed)
Patch Set: Fix debug tests 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 | « test/mjsunit/wasm/exceptions.js ('k') | test/mjsunit/wasm/ffi.js » ('j') | 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 assertEquals(String(f.index), e.a.name); 134 assertEquals(String(f.index), e.a.name);
135 })(); 135 })();
136 136
137 137
138 (function testReexportJSMultipleIdentity() { 138 (function testReexportJSMultipleIdentity() {
139 print("TestReexportMultipleIdentity..."); 139 print("TestReexportMultipleIdentity...");
140 var builder = new WasmModuleBuilder(); 140 var builder = new WasmModuleBuilder();
141 141
142 function js() {} 142 function js() {}
143 143
144 var a = builder.addImport("a", kSig_v_v); 144 var a = builder.addImport("m", "a", kSig_v_v);
145 builder.addExport("f", a); 145 builder.addExport("f", a);
146 builder.addExport("g", a); 146 builder.addExport("g", a);
147 147
148 let instance = builder.instantiate({a: js}); 148 let instance = builder.instantiate({m: {a: js}});
149 let e = instance.exports; 149 let e = instance.exports;
150 assertEquals("function", typeof e.f); 150 assertEquals("function", typeof e.f);
151 assertEquals("function", typeof e.g); 151 assertEquals("function", typeof e.g);
152 assertFalse(e.f == js); 152 assertFalse(e.f == js);
153 assertFalse(e.g == js); 153 assertFalse(e.g == js);
154 assertTrue(e.f == e.g); 154 assertTrue(e.f == e.g);
155 })(); 155 })();
156 156
157 157
158 (function testReexportJSMultiple() { 158 (function testReexportJSMultiple() {
159 print("TestReexportMultiple..."); 159 print("TestReexportMultiple...");
160 var builder = new WasmModuleBuilder(); 160 var builder = new WasmModuleBuilder();
161 161
162 function js() {} 162 function js() {}
163 163
164 var a = builder.addImport("a", kSig_v_v); 164 var a = builder.addImport("q", "a", kSig_v_v);
165 var b = builder.addImport("b", kSig_v_v); 165 var b = builder.addImport("q", "b", kSig_v_v);
166 builder.addExport("f", a); 166 builder.addExport("f", a);
167 builder.addExport("g", b); 167 builder.addExport("g", b);
168 168
169 let instance = builder.instantiate({a: js, b: js}); 169 let instance = builder.instantiate({q: {a: js, b: js}});
170 let e = instance.exports; 170 let e = instance.exports;
171 assertEquals("function", typeof e.f); 171 assertEquals("function", typeof e.f);
172 assertEquals("function", typeof e.g); 172 assertEquals("function", typeof e.g);
173 assertFalse(e.f == js); 173 assertFalse(e.f == js);
174 assertFalse(e.g == js); 174 assertFalse(e.g == js);
175 assertFalse(e.f == e.g); 175 assertFalse(e.f == e.g);
176 })(); 176 })();
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/exceptions.js ('k') | test/mjsunit/wasm/ffi.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698