diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-01-01 00:09:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-01 00:09:26 +0800 |
commit | 673b0716379e261008b6cbf187e6b212104fb69e (patch) | |
tree | 5346618caed4b6e09e9f9131b7d1a359ab893fe0 /test/compress/conditionals.js | |
parent | da82fa59a723b22ad5d8dec42cd2ca0d070f2359 (diff) | |
download | tracifyjs-673b0716379e261008b6cbf187e6b212104fb69e.tar.gz tracifyjs-673b0716379e261008b6cbf187e6b212104fb69e.zip |
enhance `join_vars` & `sequences` (#2697)
- nudge declarations without assignments
- within `AST_BlockStatement`
- across `AST_If`
Diffstat (limited to 'test/compress/conditionals.js')
-rw-r--r-- | test/compress/conditionals.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js index 4d61d39f..7838fdbb 100644 --- a/test/compress/conditionals.js +++ b/test/compress/conditionals.js @@ -1203,3 +1203,24 @@ issue_2560: { "2", ] } + +hoist_decl: { + options = { + conditionals: true, + join_vars: true, + sequences: true, + } + input: { + if (x()) { + var a; + y(); + } else { + z(); + var b; + } + } + expect: { + var a, b; + x() ? y() : z(); + } +} |