diff options
author | Daniel Wirtz <dcode@dcode.io> | 2017-08-24 18:31:15 +0200 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2017-08-24 09:31:15 -0700 |
commit | b07fafcebebab82dba46012256edc6445862cfce (patch) | |
tree | d819f110386bfe6ce3dab4aee6daeefc7f1a81ca /src/js/binaryen.js-post.js | |
parent | ac8ee6c9e7c43c80d8fb2c8166fd73f23e212069 (diff) | |
download | binaryen-b07fafcebebab82dba46012256edc6445862cfce.tar.gz binaryen-b07fafcebebab82dba46012256edc6445862cfce.tar.bz2 binaryen-b07fafcebebab82dba46012256edc6445862cfce.zip |
Initial asm.js output for binaryen-c / binaryen.js (#1136)
* Added BinaryenModulePrintAsmjs (using wasm2asm) + Module#emitAsmjs JS binding
Diffstat (limited to 'src/js/binaryen.js-post.js')
-rw-r--r-- | src/js/binaryen.js-post.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index cda00742c..985691494 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -833,6 +833,14 @@ Module['print'] = old; return ret; }; + this['emitAsmjs'] = function() { + var old = Module['print']; + var ret = ''; + Module['print'] = function(x) { ret += x + '\n' }; + Module['_BinaryenModulePrintAsmjs'](module); + Module['print'] = old; + return ret; + }; this['validate'] = function() { return Module['_BinaryenModuleValidate'](module); }; |