From b07fafcebebab82dba46012256edc6445862cfce Mon Sep 17 00:00:00 2001 From: Daniel Wirtz Date: Thu, 24 Aug 2017 18:31:15 +0200 Subject: Initial asm.js output for binaryen-c / binaryen.js (#1136) * Added BinaryenModulePrintAsmjs (using wasm2asm) + Module#emitAsmjs JS binding --- src/js/binaryen.js-post.js | 8 ++++++++ 1 file changed, 8 insertions(+) (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 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); }; -- cgit v1.2.3