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

Unified Diff: test/mjsunit/wasm/ffi-error.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/ffi.js ('k') | test/mjsunit/wasm/gc-buffer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/ffi-error.js
diff --git a/test/mjsunit/wasm/ffi-error.js b/test/mjsunit/wasm/ffi-error.js
index 521f62b50261b5bf09b3ceceb57a62c5bc770475..5b62bb9ec99722bacfce03176243679eb23690b7 100644
--- a/test/mjsunit/wasm/ffi-error.js
+++ b/test/mjsunit/wasm/ffi-error.js
@@ -11,7 +11,7 @@ function testCallFFI(ffi) {
var builder = new WasmModuleBuilder();
var sig_index = kSig_i_dd;
- builder.addImport("fun", sig_index);
+ builder.addImport("", "fun", sig_index);
builder.addFunction("main", sig_index)
.addBody([
kExprGetLocal, 0, // --
@@ -25,8 +25,7 @@ function testCallFFI(ffi) {
// everything is good.
(function() {
- var ffi = new Object();
- ffi.fun = function(a, b) { print(a, b); }
+ var ffi = {"": {fun: function(a, b) { print(a, b); }}}
testCallFFI(ffi);
})();
@@ -101,7 +100,7 @@ assertThrows(function() {
var builder = new WasmModuleBuilder();
var sig_index = builder.addType(kSig_i_i);
var sig_i64_index = builder.addType(kSig_i_l);
- var index = builder.addImport("func", sig_i64_index);
+ var index = builder.addImport("", "func", sig_i64_index);
builder.addFunction("main", sig_index)
.addBody([
kExprGetLocal, 0,
@@ -110,7 +109,7 @@ assertThrows(function() {
]) // --
.exportFunc();
var func = function() {return {};};
- var main = builder.instantiate({func: func}).exports.main;
+ var main = builder.instantiate({"": {func: func}}).exports.main;
assertThrows(function() {
main(13);
}, TypeError);
@@ -118,11 +117,11 @@ assertThrows(function() {
(function ImportSymbolToNumberThrows() {
var builder = new WasmModuleBuilder();
- var index = builder.addImport("func", kSig_i_v);
+ var index = builder.addImport("", "func", kSig_i_v);
builder.addFunction("main", kSig_i_v)
.addBody([kExprCallFunction, 0])
.exportFunc();
var func = () => Symbol();
- var main = builder.instantiate({func: func}).exports.main;
+ var main = builder.instantiate({"": {func: func}}).exports.main;
assertThrows(() => main(), TypeError);
})();
« no previous file with comments | « test/mjsunit/wasm/ffi.js ('k') | test/mjsunit/wasm/gc-buffer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698