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

Unified Diff: test/mjsunit/wasm/ffi.js

Issue 2503313002: [wasm] Fix imports with numbers as name (Closed)
Patch Set: Created 4 years, 1 month 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 | « src/wasm/wasm-module.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/ffi.js
diff --git a/test/mjsunit/wasm/ffi.js b/test/mjsunit/wasm/ffi.js
index 4b503efce43b289fb98adfd19e0e6367121eb26e..58253061055d2dad1e8d5b4b06e07926bbf8d478 100644
--- a/test/mjsunit/wasm/ffi.js
+++ b/test/mjsunit/wasm/ffi.js
@@ -295,7 +295,7 @@ testCallBinopVoid(kAstF64);
-function testCallPrint() {
+(function testCallPrint() {
ahaas 2016/11/16 10:51:18 All other tests have the style function name() {}
var builder = new WasmModuleBuilder();
builder.addImport("print", makeSig_v_x(kAstI32));
@@ -311,7 +311,30 @@ function testCallPrint() {
var main = builder.instantiate({print: print}).exports.main;
for (var i = -9; i < 900; i += 6.125) main(i);
-}
+})();
+
+
+(function testImportNumbers() {
ahaas 2016/11/16 10:51:18 nits: It's a test, you can give it long descriptiv
+ var builder = new WasmModuleBuilder();
+
+ builder.addImport('0', kSig_v_i);
-testCallPrint();
-testCallPrint();
+ builder.instantiate({0: print});
+})();
+
+(function testImportNumbers2() {
+ var builder = new WasmModuleBuilder();
+
+ builder.addImportWithModule('foo', '0', kSig_v_i);
+ builder.addImportWithModule('0', 'foo', kSig_v_i);
+ builder.addImportWithModule('0', '0', kSig_v_i);
+ builder.addImportWithModule('18', '-3', kSig_v_i);
+ builder.addImportWithModule('-3', '18', kSig_v_i);
+
+ builder.instantiate({
+ foo: {0: print},
+ 0: {0: print, foo: print},
+ 18: {'-3': print},
+ '-3': {18: print}
+ });
+})();
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698