Bug 179340

Summary: Hex, octal and binary prefixes don't support capital letters
Product: WebKit Reporter: d3x0r <d3ck0r>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: ap
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   

Description d3x0r 2017-11-06 13:22:50 PST
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.
Comment 1 Alexey Proskuryakov 2017-11-06 17:11:26 PST
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.
Comment 2 d3x0r 2017-11-06 18:19:17 PST
Oh right | 0x20; my bad.