NaN
is lexed as identifier, not as a number
#393
Labels
Milestone
NaN
is lexed as identifier, not as a number
#393
Describe the bug
When lexing
NaN
, we don't get a number, we get an identifier.To Reproduce
Run this JavaScript with
cargo run -- -t {file}.js
:Expected behavior
The token for
NaN
should be :Instead, we are getting:
This is controlled in https://github.com/jasonwilliams/boa/blob/master/boa/src/syntax/lexer/mod.rs#L591-L602. Appart from checking for
true
,false
andnull
, we should also check forNaN
and assign the correct rational, containingf64::NaN
.The text was updated successfully, but these errors were encountered: