From 067e5a5762cb5da8948ccb9bde4d020decb8d55b Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sun, 5 Mar 2017 17:15:37 +0800 Subject: fixup for #1553 (#1555) - `++a` is the one that is foldable - transform `a++` into `++a` for better optimisation --- test/compress/issue-368.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'test/compress/issue-368.js') diff --git a/test/compress/issue-368.js b/test/compress/issue-368.js index 8c41a894..5960aa64 100644 --- a/test/compress/issue-368.js +++ b/test/compress/issue-368.js @@ -21,6 +21,16 @@ collapse: { var a; a = b(a / 2); if (a < 0) { + a++; + ++c; + return c / 2; + } + } + function f4(c) { + var a; + a = b(a / 2); + if (a < 0) { + a++; c++; return c / 2; } @@ -35,7 +45,11 @@ collapse: { } function f3(c) { var a; - if ((a = b(a / 2)) < 0) return c++ / 2; + if ((a = b(a / 2)) < 0) return a++, ++c / 2; + } + function f4(c) { + var a; + if ((a = b(a / 2)) < 0) return a++, ++c / 2; } } } -- cgit v1.2.3