mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-24 20:21:48 +00:00
More options for asc; asm.js output
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
@ -743,6 +743,10 @@ export class Module {
|
||||
return _BinaryenModulePrint(this.ref);
|
||||
}
|
||||
|
||||
printAsmjs(): void {
|
||||
return _BinaryenModulePrintAsmjs(this.ref);
|
||||
}
|
||||
|
||||
toBinary(bufferSize: usize = 1048576): Uint8Array {
|
||||
// FIXME: target specific / JS glue overrides this
|
||||
throw new Error("not implemented");
|
||||
|
Reference in New Issue
Block a user