ratel-rust / ratel-core

High performance JavaScript to JavaScript compiler with a Rust core
Apache License 2.0
435 stars 17 forks source link

Parse `NaN` and `Infinity / -Infinity` #84

Closed LuoZijun closed 6 years ago

LuoZijun commented 6 years ago

Keywords:

These keywords need to be parsed into Literal, not an Identifier .

cmtt commented 6 years ago

NaN and Infinity are properties of the global object (window in a browser environment), e.g. acessible as global.NaN or global.Inifnity.

Thus, they are not parsed as special literals, see also the exhaustive list of literals in the ECMAScript 2015 specification.