diff options
Diffstat (limited to 'src/js/binaryen.js-post.js')
-rw-r--r-- | src/js/binaryen.js-post.js | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index bbf2ae237..128e148e2 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -2340,18 +2340,27 @@ function wrapModule(module, self = {}) { Module['_BinaryenAddCustomSection'](module, strToStack(name), i8sToStack(contents), contents.length) ); }; + self['getExport'] = function(externalName) { + return preserveStack(() => Module['_BinaryenGetExport'](module, strToStack(externalName))); + }; self['getNumExports'] = function() { return Module['_BinaryenGetNumExports'](module); - } - self['getExportByIndex'] = function(id) { - return Module['_BinaryenGetExportByIndex'](module, id); - } + }; + self['getExportByIndex'] = function(index) { + return Module['_BinaryenGetExportByIndex'](module, index); + }; self['getNumFunctions'] = function() { return Module['_BinaryenGetNumFunctions'](module); - } - self['getFunctionByIndex'] = function(id) { - return Module['_BinaryenGetFunctionByIndex'](module, id); - } + }; + self['getFunctionByIndex'] = function(index) { + return Module['_BinaryenGetFunctionByIndex'](module, index); + }; + self['getNumGlobals'] = function() { + return Module['_BinaryenGetNumGlobals'](module); + }; + self['getGlobalByIndex'] = function(index) { + return Module['_BinaryenGetGlobalByIndex'](module, index); + }; self['emitText'] = function() { const old = out; let ret = ''; |