Bug 182232

Summary: [JSC] Relax line terminators in String to make JSON subset of JS
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, rniwa, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews101 for mac-sierra
none
Archive of layout-test-results from ews107 for mac-sierra-wk2
none
Patch
none
Archive of layout-test-results from ews103 for mac-sierra
none
Archive of layout-test-results from ews104 for mac-sierra-wk2
none
Patch keith_miller: review+

Yusuke Suzuki
Reported 2018-01-29 00:22:04 PST
[JSC] Relax line terminators in String to make JSON subset of JS
Attachments
Patch (4.35 KB, patch)
2018-01-29 00:25 PST, Yusuke Suzuki
no flags
Archive of layout-test-results from ews101 for mac-sierra (2.18 MB, application/zip)
2018-01-29 01:25 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews107 for mac-sierra-wk2 (2.52 MB, application/zip)
2018-01-29 01:30 PST, EWS Watchlist
no flags
Patch (9.66 KB, patch)
2018-01-29 01:37 PST, Yusuke Suzuki
no flags
Archive of layout-test-results from ews103 for mac-sierra (2.34 MB, application/zip)
2018-01-29 02:36 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (2.52 MB, application/zip)
2018-01-29 02:41 PST, EWS Watchlist
no flags
Patch (9.66 KB, patch)
2018-01-29 02:48 PST, Yusuke Suzuki
keith_miller: review+
Yusuke Suzuki
Comment 1 2018-01-29 00:25:49 PST
EWS Watchlist
Comment 2 2018-01-29 01:25:47 PST
Comment on attachment 332515 [details] Patch Attachment 332515 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/6246827 New failing tests: sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3.html sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.4.html
EWS Watchlist
Comment 3 2018-01-29 01:25:48 PST
Created attachment 332521 [details] Archive of layout-test-results from ews101 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 4 2018-01-29 01:30:23 PST
Comment on attachment 332515 [details] Patch Attachment 332515 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/6246834 New failing tests: sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3.html sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.4.html
EWS Watchlist
Comment 5 2018-01-29 01:30:24 PST
Created attachment 332523 [details] Archive of layout-test-results from ews107 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Yusuke Suzuki
Comment 6 2018-01-29 01:37:28 PST
EWS Watchlist
Comment 7 2018-01-29 02:36:09 PST
Comment on attachment 332525 [details] Patch Attachment 332525 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/6247366 New failing tests: sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3.html
EWS Watchlist
Comment 8 2018-01-29 02:36:10 PST
Created attachment 332530 [details] Archive of layout-test-results from ews103 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 9 2018-01-29 02:41:41 PST
Comment on attachment 332525 [details] Patch Attachment 332525 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/6247384 New failing tests: sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3.html
EWS Watchlist
Comment 10 2018-01-29 02:41:42 PST
Created attachment 332531 [details] Archive of layout-test-results from ews104 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Yusuke Suzuki
Comment 11 2018-01-29 02:48:31 PST
Keith Miller
Comment 12 2018-01-29 10:33:17 PST
Comment on attachment 332532 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332532&action=review r=me with a nit. > Source/JavaScriptCore/parser/Lexer.cpp:1361 > - if (atEnd() || isLineTerminator(m_current)) { > + if (atEnd() || m_current == '\r' || m_current == '\n') { Why'd you make this change? Isn't isLineTerminator() always equivalent given the above check (I think LChar/UChar are always unsigned)? It might also we worth adding: static_assert(std::is_unsigned<T>::value, "Lexer expects an unsigned character type"); somewhere.
Yusuke Suzuki
Comment 13 2018-01-29 23:32:49 PST
Comment on attachment 332532 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332532&action=review Thanks >> Source/JavaScriptCore/parser/Lexer.cpp:1361 >> + if (atEnd() || m_current == '\r' || m_current == '\n') { > > Why'd you make this change? Isn't isLineTerminator() always equivalent given the above check (I think LChar/UChar are always unsigned)? > > It might also we worth adding: > > static_assert(std::is_unsigned<T>::value, "Lexer expects an unsigned character type"); > > somewhere. isLineTerminator is different. It returns true for \u2028 and \u2029. The spec change allows \u2028 and \u2029 inside string. I've added static_assert.
Yusuke Suzuki
Comment 14 2018-01-29 23:34:49 PST
Radar WebKit Bug Importer
Comment 15 2018-01-29 23:35:36 PST
Yusuke Suzuki
Comment 16 2018-01-30 04:55:22 PST
Keith Miller
Comment 17 2018-01-30 10:10:57 PST
Comment on attachment 332532 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332532&action=review >>> Source/JavaScriptCore/parser/Lexer.cpp:1361 >>> + if (atEnd() || m_current == '\r' || m_current == '\n') { >> >> Why'd you make this change? Isn't isLineTerminator() always equivalent given the above check (I think LChar/UChar are always unsigned)? >> >> It might also we worth adding: >> >> static_assert(std::is_unsigned<T>::value, "Lexer expects an unsigned character type"); >> >> somewhere. > > isLineTerminator is different. It returns true for \u2028 and \u2029. The spec change allows \u2028 and \u2029 inside string. > I've added static_assert. Right but the call to isLineTerminator is gated by the if (m_current < 0xE). So \u2028 and \u2029 wouldn't make it do the call. Maybe I'm missing something though?
Saam Barati
Comment 18 2018-01-30 14:25:40 PST
(In reply to Keith Miller from comment #17) > Comment on attachment 332532 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=332532&action=review > > >>> Source/JavaScriptCore/parser/Lexer.cpp:1361 > >>> + if (atEnd() || m_current == '\r' || m_current == '\n') { > >> > >> Why'd you make this change? Isn't isLineTerminator() always equivalent given the above check (I think LChar/UChar are always unsigned)? > >> > >> It might also we worth adding: > >> > >> static_assert(std::is_unsigned<T>::value, "Lexer expects an unsigned character type"); > >> > >> somewhere. > > > > isLineTerminator is different. It returns true for \u2028 and \u2029. The spec change allows \u2028 and \u2029 inside string. > > I've added static_assert. > > Right but the call to isLineTerminator is gated by the if (m_current < 0xE). > So \u2028 and \u2029 wouldn't make it do the call. Maybe I'm missing > something though? You're not missing anything. But I agree with Yusuke that it'd be a bit confusing to call that function in this context. (I guess unless we added some kind of assert stating it's definitely not those two unicode values)
Note You need to log in before you can comment on or make changes to this bug.