fix incorrect context in variable substitution (#1791)
authorAlex Lam S.L <alexlamsl@gmail.com>
Thu, 6 Apr 2017 19:42:17 +0000 (03:42 +0800)
committerGitHub <noreply@github.com>
Thu, 6 Apr 2017 19:42:17 +0000 (03:42 +0800)
commitcc6aa3e5ac13c0da9f2481181f5b4f11275ca8c8
treeb0876f76806180f7d14a824312944cee61482718
parente869779a988b519487da0d6e2bd8e4849cd6d9f1
fix incorrect context in variable substitution (#1791)

`AST_Node.optimize()` is context-aware, so don't cache its results to be used elsewhere.

Also fixed a few cases of AST corruption and beef up safety of `pure_getters`.
lib/compress.js
test/compress/reduce_vars.js