Currently, number literal will be parsed by the following code:
|
case SyntaxKind.NumericLiteral: |
|
const tokenValue = _scanner.getTokenValue(); |
|
let value = Number(tokenValue); |
|
|
|
if (isNaN(value)) { |
It would be better to add a feature that allow detecting the number and parsing it with BigInt, like:
// -9007199254740991 ~ 9007199254740991
// More precise checking could be used, here's only a demo
if (/^-?\d{16,}$/.test(tokenValue)) {
value = BigInt(tokenValue)
}
Currently, number literal will be parsed by the following code:
It would be better to add a feature that allow detecting the number and parsing it with BigInt, like: