Unified continue/break labels with binaryen labels; Module-level global exports

This commit is contained in:
dcodeIO
2017-12-06 17:47:48 +01:00
parent f045975a4b
commit 29468846ab
23 changed files with 192 additions and 148 deletions

View File

@ -12,6 +12,10 @@ globalScope["select"] = function select<T>(ifTrue: T, ifFalse: T, condition: boo
return condition ? ifTrue : ifFalse;
};
globalScope["assert"] = function(isTrue: bool): void {
if (!isTrue) throw new Error("assertion failed");
};
let binaryen: any;
try {
binaryen = require("binaryen");