aboutsummaryrefslogtreecommitdiff
path: root/tools/test-js-optimizer-si-output.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-03-16 11:20:26 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-03-17 17:56:17 -0700
commitdf8919a0de5ff258eff86c7e7bfcf0e01d928d10 (patch)
treee898f5f53bf1afedd0370a7b58cee7545408b9f5 /tools/test-js-optimizer-si-output.js
parentdc70532c6a3f624f8b501d64f7e26d140da8827d (diff)
fuse elses to remove unnecessary label settings and checks, after we simplified ifs
Diffstat (limited to 'tools/test-js-optimizer-si-output.js')
-rw-r--r--tools/test-js-optimizer-si-output.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/test-js-optimizer-si-output.js b/tools/test-js-optimizer-si-output.js
index 97d7fe83..a6e8f53e 100644
--- a/tools/test-js-optimizer-si-output.js
+++ b/tools/test-js-optimizer-si-output.js
@@ -103,5 +103,39 @@ function a() {
} else {
label = 5;
}
+ fuseElses();
+ if (x ? y : 0) {
+ f();
+ } else {
+ a();
+ }
+ if (x ? y : 0) {
+ f();
+ } else {
+ label = 5;
+ }
+ if ((label | 0) == 6) {
+ label = 0;
+ a();
+ }
+ if (x ? y : 0) {
+ f();
+ } else {
+ label = 5;
+ }
+ if ((label | 0) == 5) {
+ a();
+ }
+}
+function b() {
+ if (x) {
+ a();
+ } else {
+ label = 5;
+ }
+ if ((label | 0) == 5) {
+ label = 0;
+ a();
+ }
}