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

Unified Diff: test/mjsunit/wasm/import-table.js

Issue 2584843002: Implement LinkError; import tweaks (Closed)
Patch Set: 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/globals.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/import-table.js
diff --git a/test/mjsunit/wasm/import-table.js b/test/mjsunit/wasm/import-table.js
index e00e533ae179df90acc70a264d877e334ae67bbb..ffb702c7817bc4bf6effe2a9c50f98e332b61073 100644
--- a/test/mjsunit/wasm/import-table.js
+++ b/test/mjsunit/wasm/import-table.js
@@ -255,7 +255,7 @@ function testCallPrint() {
var main = builder.instantiate({print: print}).exports.main;
for (var i = -9; i < 900; i += 16.125) {
- main(i);
+ main(i);
}
}
@@ -281,3 +281,23 @@ function testCallImport2(foo, bar, expected) {
}
testCallImport2(function() { return 33; }, function () { return 44; }, 77);
+
+
+function testImportName(name) {
+ var builder = new WasmModuleBuilder();
+ builder.addImportWithModule("M", name, kSig_i_v);
+ builder.addFunction("main", kSig_i_v)
+ .addBody([
+ kExprCallFunction, 0
+ ])
+ .exportFunc();
+
+ let main = builder.instantiate({M: {[name]: () => 42}}).exports.main;
+ assertEquals(42, main());
+}
+
+testImportName("bla");
+testImportName("0");
+testImportName(" a @#$2 324 ");
+// TODO(bradnelson): This should succeed.
+// testImportName("");
« no previous file with comments | « test/mjsunit/wasm/globals.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698