RESOLVED FIXED 199984
Legacy numeric literals should not permit separators or BigInt
https://bugs.webkit.org/show_bug.cgi?id=199984
Summary Legacy numeric literals should not permit separators or BigInt
Ross Kirsling
Reported 2019-07-20 18:42:55 PDT
Legacy numeric literals should not permit separators or BigInt
Attachments
Patch (6.22 KB, patch)
2019-07-20 18:43 PDT, Ross Kirsling
no flags
Patch for landing (5.94 KB, patch)
2019-07-25 13:19 PDT, Ross Kirsling
no flags
Ross Kirsling
Comment 1 2019-07-20 18:43:30 PDT
Ross Kirsling
Comment 2 2019-07-20 18:47:21 PDT
An easily-overlooked piece of the spec -- Test262 cases were added for separators yesterday (https://github.com/tc39/test262/pull/2245) but I think they're still needed for BigInt.
Ross Kirsling
Comment 3 2019-07-22 13:27:00 PDT
(In reply to Ross Kirsling from comment #2) > An easily-overlooked piece of the spec -- Test262 cases were added for > separators yesterday (https://github.com/tc39/test262/pull/2245) but I think > they're still needed for BigInt. The rest of the test cases are in https://github.com/tc39/test262/pull/2253 (with additional BigInt + separator ones in https://github.com/tc39/test262/pull/2252). One way or another, the key is that neither proposal is meant to add to Annex B.1.1's LegacyOctalIntegerLiteral and NonOctalDecimalIntegerLiteral.
Caio Lima
Comment 4 2019-07-23 14:25:14 PDT
Comment on attachment 374564 [details] Patch LGTM
Keith Miller
Comment 5 2019-07-25 10:37:40 PDT
Comment on attachment 374564 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=374564&action=review r=me. > Source/JavaScriptCore/parser/Lexer.cpp:1628 > + bool isLegacyLiteral = m_buffer8.size(); For clarity can you add: ASSERT(!m_buffer8.size() || (m_buffer8.size() == 1 && m_buffer[0] == '0'));
Keith Miller
Comment 6 2019-07-25 10:38:52 PDT
Comment on attachment 374564 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=374564&action=review > JSTests/stress/numeric-literal-separators.js:75 > +shouldThrow('010000000000_1', SyntaxError); > +shouldThrow('010000000000_9', SyntaxError); > +shouldThrow('090000000000_1', SyntaxError); Can you add tests for 0100_004 and 0_000 etc?
Ross Kirsling
Comment 7 2019-07-25 13:19:59 PDT
Created attachment 374900 [details] Patch for landing
WebKit Commit Bot
Comment 8 2019-07-25 16:55:51 PDT
Comment on attachment 374900 [details] Patch for landing Clearing flags on attachment: 374900 Committed r247845: <https://trac.webkit.org/changeset/247845>
WebKit Commit Bot
Comment 9 2019-07-25 16:55:53 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10 2019-07-25 16:58:30 PDT
Note You need to log in before you can comment on or make changes to this bug.