summaryrefslogtreecommitdiff
path: root/test/binaryen.js/stackir.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/binaryen.js/stackir.js')
-rw-r--r--test/binaryen.js/stackir.js22
1 files changed, 7 insertions, 15 deletions
diff --git a/test/binaryen.js/stackir.js b/test/binaryen.js/stackir.js
index 324a99abe..20754e078 100644
--- a/test/binaryen.js/stackir.js
+++ b/test/binaryen.js/stackir.js
@@ -1,7 +1,3 @@
-function assert(x) {
- if (!x) throw 'error!';
-}
-
var wast = `
(module
(type $i (func (param i32) (result i32)))
@@ -21,17 +17,13 @@ var wast = `
)
`;
-function test() {
- console.log("=== input wast ===" + wast);
-
- var module = Binaryen.parseText(wast);
- assert(module.validate());
+console.log("=== input wast ===" + wast);
- console.log("=== default ===");
- console.log(module.emitStackIR());
+var module = binaryen.parseText(wast);
+assert(module.validate());
- console.log("=== optimize ==="); // should omit the second block
- console.log(module.emitStackIR(true));
-}
+console.log("=== default ===");
+console.log(module.emitStackIR());
-Binaryen.ready.then(test);
+console.log("=== optimize ==="); // should omit the second block
+console.log(module.emitStackIR(true));