fix stack issues with `AST_Node.evaluate()` (#1603)
authorAlex Lam S.L <alexlamsl@gmail.com>
Wed, 15 Mar 2017 17:02:59 +0000 (01:02 +0800)
committerGitHub <noreply@github.com>
Wed, 15 Mar 2017 17:02:59 +0000 (01:02 +0800)
commitcf4bf4ceb1eee86197d51e77e640e59ca04739b8
tree0e6aa50e33206fa4ec35ed8cfeee2532a9b42550
parent8223b2e0db4cc41d467d9b94b05511a36c320184
fix stack issues with `AST_Node.evaluate()` (#1603)

As patched in #1597, `make_node_from_constant()` makes inconsistent and sometimes incorrect calls to `optimize()` and `transform()`.

Fix those issues properly by changing the semantics of `evaluate()` and `make_node_from_constant()`, with the side effect that `evaluate()` no longer eagerly converts constant to `AST_Node`.
lib/compress.js