Skip to content

Commit 9cfca02

Browse files
lydellJimPanic
authored andcommitted
Handle very large hexadecimal number literals correctly
Very large decimal number literals, binary number literals and octal literals are lexed into an INFINITY token (instead of a NUMBER token) and compiled into `2e308`. That is is supposed to be the case for very large hexdecimal dumber literals as well, but previously wasn't. Before: $ node -p 'require("./").tokens(`0x${Array(256 + 1).join("f")}`)[0][0]' NUMBER After: $ node -p 'require("./").tokens(`0x${Array(256 + 1).join("f")}`)[0][0]' INFINITY This commit also cleans up `numberToken` in lexer.coffee a bit.
1 parent 54f429b commit 9cfca02

File tree

1 file changed

+35
-24
lines changed

1 file changed

+35
-24
lines changed

lib/coffee-script/lexer.js

Lines changed: 35 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)