safer `properties` transform (#2391)
authorAlex Lam S.L <alexlamsl@gmail.com>
Sun, 22 Oct 2017 12:10:13 +0000 (20:10 +0800)
committerGitHub <noreply@github.com>
Sun, 22 Oct 2017 12:10:13 +0000 (20:10 +0800)
commit24aa07855bc608f29cca2a58a40af1988256b116
tree52428c6db4496e196b2837dbe7b73324e32558b5
parent5fd723f14394b74f899e7b33bc9084317bf01d7d
safer `properties` transform (#2391)

`{ a: x, b: y }.a` => `[ x, y ][0]`
- `x` cannot be function containing `this`

`[ x, y, z ][1]` => `(x, z, y)`
- only if `z` is side-effect-free
lib/compress.js
test/compress/collapse_vars.js
test/compress/evaluate.js
test/compress/functions.js
test/compress/properties.js
test/compress/reduce_vars.js