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

Unified Diff: test/mjsunit/wasm/globals.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/wasm/gc-stress.js ('k') | test/mjsunit/wasm/import-memory.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/globals.js
diff --git a/test/mjsunit/wasm/globals.js b/test/mjsunit/wasm/globals.js
index 46babe3c0723b5b12d1e6eb1804df75bb3d27f99..d1ee9600746bb78a51b57c30a41abd3cc2391a2c 100644
--- a/test/mjsunit/wasm/globals.js
+++ b/test/mjsunit/wasm/globals.js
@@ -11,13 +11,13 @@ function TestImported(type, val, expected) {
print("TestImported " + type + "(" + val +")" + " = " + expected);
var builder = new WasmModuleBuilder();
var sig = makeSig([], [type]);
- var g = builder.addImportedGlobal("foo", undefined, type);
+ var g = builder.addImportedGlobal("uuu", "foo", type);
builder.addFunction("main", sig)
.addBody([kExprGetGlobal, g.index])
.exportAs("main");
builder.addGlobal(kAstI32); // pad
- var instance = builder.instantiate({foo: val});
+ var instance = builder.instantiate({uuu: {foo: val}});
assertEquals(expected, instance.exports.main());
}
@@ -49,14 +49,14 @@ function TestImportedExported(type, val, expected) {
print("TestImportedExported " + type + "(" + val +")" + " = " + expected);
var builder = new WasmModuleBuilder();
var sig = makeSig([type], []);
- var i = builder.addImportedGlobal("foo", undefined, type);
+ var i = builder.addImportedGlobal("ttt", "foo", type);
builder.addGlobal(kAstI32); // pad
var o = builder.addGlobal(type, false)
.exportAs("bar");
o.init_index = i;
builder.addGlobal(kAstI32); // pad
- var instance = builder.instantiate({foo: val});
+ var instance = builder.instantiate({ttt: {foo: val}});
assertEquals(expected, instance.exports.bar);
}
@@ -67,7 +67,7 @@ TestImportedExported(kAstF64, 81347.66666, 81347.66666);
function TestGlobalIndexSpace(type, val) {
print("TestGlobalIndexSpace(" + val + ") = " + val);
var builder = new WasmModuleBuilder();
- var im = builder.addImportedGlobal("foo", undefined, type);
+ var im = builder.addImportedGlobal("nnn", "foo", type);
assertEquals(0, im);
var def = builder.addGlobal(type, false);
assertEquals(1, def.index);
@@ -78,7 +78,7 @@ function TestGlobalIndexSpace(type, val) {
.addBody([kExprGetGlobal, def.index])
.exportAs("main");
- var instance = builder.instantiate({foo: val});
+ var instance = builder.instantiate({nnn: {foo: val}});
assertEquals(val, instance.exports.main());
}
« no previous file with comments | « test/mjsunit/wasm/gc-stress.js ('k') | test/mjsunit/wasm/import-memory.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698