diff options
Diffstat (limited to 'src/js/wasm.js-post.js')
-rw-r--r-- | src/js/wasm.js-post.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/js/wasm.js-post.js b/src/js/wasm.js-post.js index 90c2f18b8..2b5ed69b2 100644 --- a/src/js/wasm.js-post.js +++ b/src/js/wasm.js-post.js @@ -298,8 +298,13 @@ function integrateWasmJS(Module) { if (!env['table']) { var TABLE_SIZE = Module['wasmTableSize']; if (TABLE_SIZE === undefined) TABLE_SIZE = 1024; // works in binaryen interpreter at least + var MAX_TABLE_SIZE = Module['wasmMaxTableSize']; if (typeof WebAssembly === 'object' && typeof WebAssembly.Table === 'function') { - env['table'] = new WebAssembly.Table({ initial: TABLE_SIZE, maximum: TABLE_SIZE, element: 'anyfunc' }); + if (MAX_TABLE_SIZE !== undefined) { + env['table'] = new WebAssembly.Table({ initial: TABLE_SIZE, maximum: MAX_TABLE_SIZE, element: 'anyfunc' }); + } else { + env['table'] = new WebAssembly.Table({ initial: TABLE_SIZE, element: 'anyfunc' }); + } } else { env['table'] = new Array(TABLE_SIZE); // works in binaryen interpreter at least } |