diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-02-26 00:40:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-26 00:40:33 +0800 |
commit | 16cd5d57a5cf7f5750104df0e5af246708fd493f (patch) | |
tree | e9ea6b8432ce0bddeeeef317f96765de1467ceeb /test/compress/reduce_vars.js | |
parent | 834f9f39245f1ddf5a29c579afd7ebcdb0afe585 (diff) | |
download | tracifyjs-16cd5d57a5cf7f5750104df0e5af246708fd493f.tar.gz tracifyjs-16cd5d57a5cf7f5750104df0e5af246708fd493f.zip |
consolidate `evaluate` & `reduce_vars` (#1505)
- improve marking efficiency
- apply smarter `const` replacement to `var`
fixes #1501
Diffstat (limited to 'test/compress/reduce_vars.js')
-rw-r--r-- | test/compress/reduce_vars.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index d9d02efa..0ee201c0 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -134,8 +134,8 @@ modified: { } function f2() { - var b = 2, c = 3; - b = c; + var b = 2; + b = 3; console.log(1 + b); console.log(b + 3); console.log(4); @@ -143,8 +143,8 @@ modified: { } function f3() { - var b = 2, c = 3; - b *= c; + var b = 2; + b *= 3; console.log(1 + b); console.log(b + 3); console.log(4); @@ -236,7 +236,7 @@ unsafe_evaluate_object: { function f0(){ var a = 1; var b = {}; - b[a] = 2; + b[1] = 2; console.log(4); } @@ -280,7 +280,7 @@ unsafe_evaluate_array: { function f0(){ var a = 1; var b = []; - b[a] = 2; + b[1] = 2; console.log(4); } @@ -373,8 +373,8 @@ passes: { } expect: { function f() { - var b = 2, c = 3; - b = c; + var b = 2; + b = 3; console.log(1 + b); console.log(b + 3); console.log(4); |