More options for asc; asm.js output

This commit is contained in:
dcodeIO
2017-12-09 00:45:12 +01:00
parent 64516eecfb
commit bbc71ebe81
5 changed files with 79 additions and 14 deletions

View File

@ -40,3 +40,12 @@ Module.prototype.toText = function toText() {
binaryen.print = previousPrint;
return ret;
}
Module.prototype.toAsmjs = function toAsmjs() {
var previousPrint = binaryen.print;
var ret = "";
binaryen.print = function print(x) { ret += x + "\n" };
this.printAsmjs();
binaryen.print = previousPrint;
return ret;
}