Fix #597
authorRichard van Velzen <rvanvelzen1@gmail.com>
Wed, 31 Dec 2014 11:23:00 +0000 (12:23 +0100)
committerRichard van Velzen <rvanvelzen1@gmail.com>
Wed, 31 Dec 2014 11:23:00 +0000 (12:23 +0100)
commitc75f5a1fd85368edb3456637c544dee0cad1011e
tree63f5e62bf51c269fb570e9287d36eb9cdc014d09
parent5538ec7bd8a64c7fcc45895308a8463e4ca4d00a
Fix #597

NaN and Infinity were replaced in the output generation, instead of
during compression. This could lead to results where `1/0` was inserted
without parens leading to invalid output.

The nodes are replaced in the compression step now, and the output
generation returns their regular names. This should not be a problem,
since they're already only constructed from the original name.
lib/compress.js
lib/output.js
test/compress/issue-597.js [new file with mode: 0644]