diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-04-07 13:31:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-07 13:31:58 +0800 |
commit | 0f4cd73dcc5d8a936ae3630a7992dbcb44274136 (patch) | |
tree | 3c5724a3ef73c80868849800630c92d57d28b806 /test/compress/pure_getters.js | |
parent | 281e882d27ace48c5c415f19292e2590dd4473dc (diff) | |
download | tracifyjs-0f4cd73dcc5d8a936ae3630a7992dbcb44274136.tar.gz tracifyjs-0f4cd73dcc5d8a936ae3630a7992dbcb44274136.zip |
introduce "strict" to `pure_getters` (#1795)
Diffstat (limited to 'test/compress/pure_getters.js')
-rw-r--r-- | test/compress/pure_getters.js | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/test/compress/pure_getters.js b/test/compress/pure_getters.js index 338f8639..c2dcb95b 100644 --- a/test/compress/pure_getters.js +++ b/test/compress/pure_getters.js @@ -1,10 +1,9 @@ -side_effects: { +strict: { options = { - pure_getters: true, + pure_getters: "strict", reduce_vars: false, side_effects: true, toplevel: true, - unsafe: false, } input: { var a, b = null, c = {}; @@ -28,13 +27,12 @@ side_effects: { } } -side_effects_reduce_vars: { +strict_reduce_vars: { options = { - pure_getters: true, + pure_getters: "strict", reduce_vars: true, side_effects: true, toplevel: true, - unsafe: false, } input: { var a, b = null, c = {}; @@ -57,13 +55,38 @@ side_effects_reduce_vars: { } } -side_effects_unsafe: { +unsafe: { options = { pure_getters: true, reduce_vars: false, side_effects: true, toplevel: true, - unsafe: true, + } + input: { + var a, b = null, c = {}; + a.prop; + b.prop; + c.prop; + d.prop; + null.prop; + (void 0).prop; + undefined.prop; + } + expect: { + var a, b = null, c = {}; + d; + null.prop; + (void 0).prop; + (void 0).prop; + } +} + +unsafe_reduce_vars: { + options = { + pure_getters: true, + reduce_vars: true, + side_effects: true, + toplevel: true, } input: { var a, b = null, c = {}; |