diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-04-29 08:55:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-29 08:55:46 +0800 |
commit | 413bbe0480d28d18833fbc3ebdb68fa74138d758 (patch) | |
tree | 81fd4736065aa6a8d319568a05959d3f314aa7f6 /test/compress/reduce_vars.js | |
parent | 34075fc4c44eaf3369ffa76a1c7fa4f8281456bd (diff) | |
download | tracifyjs-413bbe0480d28d18833fbc3ebdb68fa74138d758.tar.gz tracifyjs-413bbe0480d28d18833fbc3ebdb68fa74138d758.zip |
fix corner case in `evaluate` (#3388)
fixes #3387
Diffstat (limited to 'test/compress/reduce_vars.js')
-rw-r--r-- | test/compress/reduce_vars.js | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index 7ad8ab94..1796ecbe 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -192,38 +192,35 @@ unsafe_evaluate: { unused: true, } input: { - function f0(){ - var a = { - b:1 - }; + function f0() { + var a = { b: 1 }; console.log(a.b + 3); } - - function f1(){ + function f1() { var a = { - b:{ - c:1 - }, - d:2 + b: { c: 1 }, + d: 2 }; console.log(a.b + 3, a.d + 4, a.b.c + 5, a.d.c + 6); } + f0(); + f1(); } expect: { - function f0(){ + function f0() { console.log(4); } - - function f1(){ + function f1() { var a = { - b:{ - c:1 - }, - d:2 + b: { c: 1 }, + d: 2 }; - console.log(a.b + 3, 6, 6, 2..c + 6); + console.log(a.b + 3, 6, 6, NaN); } + f0(); + f1(); } + expect_stdout: true } unsafe_evaluate_side_effect_free_1: { |