mishoo/UglifyJS — pull request #410 by RGustBardon (2012-06-05 17:47:22+00:00)
Title: Fix representation of infinite values

Infinite numbers (NaN and Infinity) were represented incorrectly due
to make_num using the Number.prototype.toString method (15.7.4.2)
which in turn performs the abstract operation ToString (9.8) which
returns a string "NaN" or "Infinity" in accordance with the first and
the fourth step of 9.8.1.

As the corresponding value properties of the global object can be
"shadowed", representing such numbers as "NaN" and "Infinity" can lead
to incorrect behavior. For example:

```javascript
with({
get NaN() {
throw new Error();
}
}) {
0 / 0;
}
```

This patch checks for the values in question in the make_num function
and represents them using MultiplicativeExpression nonterminals
(e.g. "0/0" instead of "NaN").