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"]()); |
+})(); |