json5 / json5-spec

The JSON5 Data Interchange Format
https://spec.json5.org
MIT License
49 stars 11 forks source link

Numeric representation (binary & octal & grouping digits) #40

Closed tats-u closed 2 years ago

tats-u commented 2 years ago

I hope JSON5 supports these numeric representations supported by ES6 or ES2021.

> node
Welcome to Node.js v14.15.4.
Type ".help" for more information.
> 0o755
493
> 0b0100_0000
64
> 1_000_000
1000000
jordanbtucker commented 2 years ago

Thanks for the suggestion, but we've settled on keeping JSON5's features compatible with ES5, so no ES6 features will be added.

tats-u commented 2 years ago

keeping JSON5's features compatible with ES5

Is it intended to make JSON5 eval-able even in dying IE? If so you might want to reconsider this specification.

FYI these do not break the backward compatibility because all of them cause syntax errors.