summaryrefslogtreecommitdiff
path: root/src/js/binaryen.js-post.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/binaryen.js-post.js')
-rw-r--r--src/js/binaryen.js-post.js8
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);
};