aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-02-04 04:18:22 +0800
committerGitHub <noreply@github.com>2018-02-04 04:18:22 +0800
commit3026bd89759446c9c5d6fa1cd69651f853ffe08d (patch)
tree1c420cfadf2844b3903579b37883394b59758e43 /test/compress
parent78a44d5ab0fd2195c8f22cc8a39193b33dad6188 (diff)
downloadtracifyjs-3026bd89759446c9c5d6fa1cd69651f853ffe08d.tar.gz
tracifyjs-3026bd89759446c9c5d6fa1cd69651f853ffe08d.zip
improve exceptional flow compression by `collapse_vars` (#2880)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/collapse_vars.js18
1 files changed, 6 insertions, 12 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index 4191de85..19db6058 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -4281,19 +4281,16 @@ cond_branch_1: {
}
expect: {
function f1(b, c) {
- var log = console.log;
if (b) b++;
- log(++c, b);
+ (0, console.log)(++c, b);
}
function f2(b, c) {
- var log = console.log;
b && b++,
- log(++c, b);
+ (0, console.log)(++c, b);
}
function f3(b, c) {
- var log = console.log;
b ? b++ : b--,
- log(++c, b);
+ (0, console.log)(++c, b);
}
f1(1, 2),
f2(3, 4),
@@ -4337,22 +4334,19 @@ cond_branch_2: {
}
expect: {
function f1(b, c) {
- var log = console.log;
var a = ++c;
if (b) b += a;
- log(a, b);
+ (0, console.log)(a, b);
}
function f2(b, c) {
- var log = console.log;
var a = ++c;
b && (b += a),
- log(a, b);
+ (0, console.log)(a, b);
}
function f3(b, c) {
- var log = console.log;
var a = ++c;
b ? b += a : b--,
- log(a, b);
+ (0, console.log)(a, b);
}
f1(1, 2),
f2(3, 4),