summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wasm2js.h3
-rw-r--r--test/wasm2js/dynamicLibrary.2asm.js2
-rw-r--r--test/wasm2js/dynamicLibrary.2asm.js.opt2
3 files changed, 3 insertions, 4 deletions
diff --git a/src/wasm2js.h b/src/wasm2js.h
index cb7bfd20d..0a2e45d49 100644
--- a/src/wasm2js.h
+++ b/src/wasm2js.h
@@ -598,8 +598,7 @@ void Wasm2JSBuilder::addTable(Ref ast, Module* wasm) {
Ref theVar = ValueBuilder::makeVar();
ast->push_back(theVar);
- Ref table =
- ValueBuilder::makeNew(ValueBuilder::makeCall(IString("Table"), theArray));
+ Ref table = ValueBuilder::makeCall(IString("Table"), theArray);
ValueBuilder::appendToVar(theVar, FUNCTION_TABLE, table);
} else if (!wasm->table.imported()) {
// Otherwise if the table is internal (neither imported not exported).
diff --git a/test/wasm2js/dynamicLibrary.2asm.js b/test/wasm2js/dynamicLibrary.2asm.js
index c750310b7..1824b2b9b 100644
--- a/test/wasm2js/dynamicLibrary.2asm.js
+++ b/test/wasm2js/dynamicLibrary.2asm.js
@@ -48,7 +48,7 @@ function asmFunc(global, env, buffer) {
}
- var FUNCTION_TABLE = new Table(new Array(10));
+ var FUNCTION_TABLE = Table(new Array(10));
FUNCTION_TABLE[import$tableBase + 0] = foo;
FUNCTION_TABLE[import$tableBase + 1] = bar;
function __wasm_memory_size() {
diff --git a/test/wasm2js/dynamicLibrary.2asm.js.opt b/test/wasm2js/dynamicLibrary.2asm.js.opt
index d503abf0b..42af848b6 100644
--- a/test/wasm2js/dynamicLibrary.2asm.js.opt
+++ b/test/wasm2js/dynamicLibrary.2asm.js.opt
@@ -40,7 +40,7 @@ function asmFunc(global, env, buffer) {
}
- var FUNCTION_TABLE = new Table(new Array(10));
+ var FUNCTION_TABLE = Table(new Array(10));
FUNCTION_TABLE[import$tableBase + 0] = foo;
FUNCTION_TABLE[import$tableBase + 1] = foo;
function __wasm_memory_size() {