Bug 179340
| Summary: | Hex, octal and binary prefixes don't support capital letters | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | d3x0r <d3ck0r> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | ap |
| Priority: | P2 | ||
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
d3x0r
https://github.com/WebKit/webkit/blob/master/Source/JavaScriptCore/parser/Lexer.cpp#L2104
Was browsing the source to see how numbers were parsed for potential complexity in supporting proposal https://github.com/tc39/proposal-numeric-separator .
I found that only 'x', 'b', and 'o' is supported for numbers, although the standard says that capital or lower case letters should be allowed.
https://www.ecma-international.org/ecma-262/6.0/#sec-literals-numeric-literals
(ES6) I see that ES5 did not support 'o' or 'b' either.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
I cannot reproduce in Safari 11.0.1. When I type "0XA" in Web Inspector console, I get "10" back.
Looking at the code, it does ignore the case - that's what "m_current | 0x20" is for.
d3x0r
Oh right | 0x20; my bad.