implement delayed resolution for `reduce_vars` (#1788)
authorAlex Lam S.L <alexlamsl@gmail.com>
Wed, 5 Apr 2017 13:06:42 +0000 (21:06 +0800)
committerGitHub <noreply@github.com>
Wed, 5 Apr 2017 13:06:42 +0000 (21:06 +0800)
commitff289b90a92739641dcb7fc7f6c8ecf8ee74d15f
tree5fdcaa56885b3a20659009a854329b5d256f8fa3
parent9b6bc67c3393507d0621eb3debbe8845b0eff52d
implement delayed resolution for `reduce_vars` (#1788)

Although it would be nice to enforce `AST_Node` cloning during transformation, that ship has sailed a long time ago.

We now get the assigned value when resolving `AST_SymbolRef` instead of `reset_opt_flags()`, which has the added advantage of improved compressor efficiency.

fixes #1787
lib/compress.js
test/compress/issue-1609.js
test/compress/issue-1787.js [new file with mode: 0644]