Closed LuoZijun closed 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.
Keywords:
NaN / +NaN / -NaN
-->std::f64::NAN
Infinity / +Infinity
-->std::f64::INFINITY
-Infinity
-->std::f64::NEG_INFINITY
These keywords need to be parsed into
Literal
, not anIdentifier
.