fix `AST_Node.optimize()` (#1602)
authorAlex Lam S.L <alexlamsl@gmail.com>
Wed, 15 Mar 2017 10:44:13 +0000 (18:44 +0800)
committerGitHub <noreply@github.com>
Wed, 15 Mar 2017 10:44:13 +0000 (18:44 +0800)
commit8223b2e0db4cc41d467d9b94b05511a36c320184
tree2bedd267ee865aec6aa7fe99e250d00f0a512a99
parent381bd3836ecd79eb5d4f7b84807c778ee1acf9c9
fix `AST_Node.optimize()` (#1602)

Liberal use of `Compressor.transform()` and `AST_Node.optimize()` presents an issue for look-up operations like `TreeWalker.in_boolean_context()` and `TreeWalker.parent()`.

This is an incremental fix such that `AST_Node.optimize()` would now contain the correct stack information when called correctly.
lib/compress.js
lib/utils.js
test/compress/transform.js [new file with mode: 0644]