diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-12-24 00:36:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-24 00:36:46 +0800 |
commit | c07ea17c015cb2e0fa3f48927751186ecb421481 (patch) | |
tree | 6ab753f93e87acd00e8a6a0e3a08ab38b5baa3ee /test | |
parent | edb4e3bd52e1623425927a7d63963ba3b87a3ec2 (diff) | |
download | tracifyjs-c07ea17c015cb2e0fa3f48927751186ecb421481.tar.gz tracifyjs-c07ea17c015cb2e0fa3f48927751186ecb421481.zip |
fix escape analysis on `AST_PropAccess` (#2636)
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/reduce_vars.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index bf1155b7..2b2c77da 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -3423,6 +3423,37 @@ escaped_prop_1: { escaped_prop_2: { options = { + collapse_vars: true, + evaluate: true, + inline: true, + passes: 2, + pure_getters: "strict", + reduce_funcs: true, + reduce_vars: true, + side_effects: true, + toplevel: true, + unsafe: true, + unused: true, + } + input: { + var obj = { o: { a: 1 } }; + (function(o) { + o.a++; + })(obj.o); + (function(o) { + console.log(o.a); + })(obj.o); + } + expect: { + var obj = { o: { a: 1 } }; + obj.o.a++; + console.log(obj.o.a); + } + expect_stdout: "2" +} + +escaped_prop_3: { + options = { reduce_funcs: true, reduce_vars: true, toplevel: true, |