Bug 179340 - Hex, octal and binary prefixes don't support capital letters
Summary: Hex, octal and binary prefixes don't support capital letters
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-06 13:22 PST by d3x0r
Modified: 2017-11-06 18:19 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.