augment evaluate to extract within objects (#1425)
authorAlex Lam S.L <alexlamsl@gmail.com>
Thu, 26 Jan 2017 11:14:18 +0000 (19:14 +0800)
committerRichard van Velzen <rvanvelzen1@gmail.com>
Thu, 26 Jan 2017 11:14:18 +0000 (12:14 +0100)
commit0d7d4918eb6fb73c3cf9863479b3e66d38fad6df
treeaba146adb5371e19935493b132fc605abbe081ca
parent48284844a461e6113bb9911cdcdad7ab8a3d85de
augment evaluate to extract within objects (#1425)

- gated by `unsafe`
- replaces previous optimisation specific to String.length
- "123"[0] => 1
- [1, 2, 3][0] => 1
- [1, 2, 3].length => 3
- does not apply to objects with overridden prototype functions
lib/compress.js
lib/scope.js
test/compress/arrays.js
test/compress/evaluate.js
test/compress/properties.js
test/compress/reduce_vars.js