diff options
author | Jay Phelps <hello@jayphelps.com> | 2018-09-01 10:58:11 -0400 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2018-09-01 07:58:11 -0700 |
commit | 9750c18faba7be48f9e086fd2d00838ca4ae9d0f (patch) | |
tree | 2610f3c7fb2613804ba649083cd838703a569150 /src/js | |
parent | 480acf06144a056ee3569823e7cb65fea42cf808 (diff) | |
download | binaryen-9750c18faba7be48f9e086fd2d00838ca4ae9d0f.tar.gz binaryen-9750c18faba7be48f9e086fd2d00838ca4ae9d0f.tar.bz2 binaryen-9750c18faba7be48f9e086fd2d00838ca4ae9d0f.zip |
BinaryenSetFunctionTable now accepts array of func names not funcs. (#1650)
This allows using imports in the table.
Fixes #1645
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/binaryen.js-post.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index b61b8c3e2..f387acb4f 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -1129,9 +1129,11 @@ Module['Module'] = function(module) { return Module['_BinaryenRemoveExport'](module, strToStack(externalName)); }); }; - this['setFunctionTable'] = function(funcs) { + this['setFunctionTable'] = function(funcNames) { return preserveStack(function() { - return Module['_BinaryenSetFunctionTable'](module, i32sToStack(funcs), funcs.length); + return Module['_BinaryenSetFunctionTable'](module, i32sToStack( + funcNames.map(strToStack) + ), funcNames.length); }); }; this['setMemory'] = function(initial, maximum, exportName, segments) { |