From 9750c18faba7be48f9e086fd2d00838ca4ae9d0f Mon Sep 17 00:00:00 2001 From: Jay Phelps Date: Sat, 1 Sep 2018 10:58:11 -0400 Subject: BinaryenSetFunctionTable now accepts array of func names not funcs. (#1650) This allows using imports in the table. Fixes #1645 --- src/js/binaryen.js-post.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/js/binaryen.js-post.js') 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) { -- cgit v1.2.3