google / google/closure-compiler
Infinity and NaN are not optimized
Open
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
`Infinity` and `-Infinity` can be optimized into `1/0` and `-1/0` respectively. `NaN` can be optimized into `0/0`. While there is no size benefit to optimizing `NaN`, there is a performance benefit. `NaN` is a window property. As such, using `NaN` forces the browser to add in extra checks incaseif `window.NaN` is changed by some oafish moron as per the W3 spec which (unfourtunatly) permits the free roam of such idiots.
Contributor guide
Assessment
This issue has not been assessed yet.