WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
182232
[JSC] Relax line terminators in String to make JSON subset of JS
https://bugs.webkit.org/show_bug.cgi?id=182232
Summary
[JSC] Relax line terminators in String to make JSON subset of JS
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
Details
Formatted Diff
Diff
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
Details
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
Details
Patch
(9.66 KB, patch)
2018-01-29 01:37 PST
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
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
Details
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
Details
Patch
(9.66 KB, patch)
2018-01-29 02:48 PST
,
Yusuke Suzuki
keith_miller
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2018-01-29 00:25:49 PST
Created
attachment 332515
[details]
Patch
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
Created
attachment 332525
[details]
Patch
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
Created
attachment 332532
[details]
Patch
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
Committed
r227775
: <
https://trac.webkit.org/changeset/227775
>
Radar WebKit Bug Importer
Comment 15
2018-01-29 23:35:36 PST
<
rdar://problem/37018683
>
Yusuke Suzuki
Comment 16
2018-01-30 04:55:22 PST
Committed
r227780
: <
https://trac.webkit.org/changeset/227780
>
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.
Top of Page
Format For Printing
XML
Clone This Bug