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

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

Issue 1896863003: [wasm] Binary 11: Module changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months 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/divrem-trap.js ('k') | test/mjsunit/wasm/ffi.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/export-table.js
diff --git a/test/mjsunit/wasm/export-table.js b/test/mjsunit/wasm/export-table.js
index 768e22a304852200525b8ed393d81d53663fcc79..a41d85dbc79c9480b745071275fae552a1a1c572 100644
--- a/test/mjsunit/wasm/export-table.js
+++ b/test/mjsunit/wasm/export-table.js
@@ -11,7 +11,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
var kReturnValue = 88;
var builder = new WasmModuleBuilder();
- builder.addFunction("main", [kAstI32])
+ builder.addFunction("main", kSig_i)
.addBody([
kExprI8Const,
kReturnValue,
@@ -32,7 +32,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
var builder = new WasmModuleBuilder();
- builder.addFunction("main", [kAstI32])
+ builder.addFunction("main", kSig_i)
.addBody([
kExprI8Const,
kReturnValue,
@@ -50,3 +50,25 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
assertEquals(kReturnValue, module.exports.foo());
assertEquals(kReturnValue, module.exports.blah());
})();
+
+
+(function testNumericName() {
+ var kReturnValue = 93;
+
+ var builder = new WasmModuleBuilder();
+
+ builder.addFunction("main", kSig_i)
+ .addBody([
+ kExprI8Const,
+ kReturnValue,
+ kExprReturn, kArity1
+ ])
+ .exportAs("0");
+
+ var module = builder.instantiate();
+
+ assertEquals("object", typeof module.exports);
+ assertEquals("function", typeof module.exports["0"]);
+
+ assertEquals(kReturnValue, module.exports["0"]());
+})();
« no previous file with comments | « test/mjsunit/wasm/divrem-trap.js ('k') | test/mjsunit/wasm/ffi.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698