mirror of
https://github.com/espruino/Espruino.git
synced 2026-01-25 14:47:38 +00:00
This is an initial working version, but it has some known bugs:
* parseInt("1_0") returns 10, not 1. That's a breaking change
* multiple separators in a row is supported, but that's not supported according to the spec
21 lines
250 B
JavaScript
21 lines
250 B
JavaScript
var tests=0, testpass=0;
|
|
function t(x) {
|
|
console.log(x);
|
|
tests++;
|
|
if (x) testpass++;
|
|
}
|
|
|
|
t( 0x01 === 1);
|
|
t( 0X01 === 1);
|
|
|
|
t( 0b01 === 1);
|
|
t( 0B01 === 1);
|
|
|
|
t( 0o01 === 1);
|
|
t( 0O01 === 1);
|
|
|
|
t( 1_0 === 10);
|
|
t( 0x0_1 === 1);
|
|
|
|
result = tests==testpass;
|