Summary: | Intl.DateTimeFormat incorrectly parses patterns with 'h' literal | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Devon Govett <govett> | ||||
Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | ews-watchlist, keith_miller, mark.lam, msaboff, ross.kirsling, saam, tzagallo, webkit-bug-importer, ysuzuki | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | Safari Technology Preview | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Devon Govett
2021-08-19 17:16:46 PDT
Nice catch! Created attachment 436610 [details]
Patch
Comment on attachment 436610 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=436610&action=review r=me with comments (about the comments :P) > Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp:313 > + // 'ICU''s change' is "ICU's change" literal text, but even if we split this text into two literal texts, The use of quotes on this line confused me at first—it would be easier to understand if you quote the first part too, maybe like `'ICU''s change'`. > Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp:346 > + // 2. Literal text, which is output as-is when formatting, and must closely match when > + // parsing. Literal text can include: Any characters other than A..Z and a..z, > + // including spaces and punctuation. Any text between single vertical quotes ('xxxx'), > + // which may include A..Z and a..z as literal text. Two adjacent single vertical quotes > + // (''), which represent a literal single quote, either inside or outside quoted text. This is okay but since the last three sentences are intended as a bullet list, it seems like you should write it as one. Comment on attachment 436610 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=436610&action=review Thanks! >> Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp:313 >> + // 'ICU''s change' is "ICU's change" literal text, but even if we split this text into two literal texts, > > The use of quotes on this line confused me at first—it would be easier to understand if you quote the first part too, maybe like `'ICU''s change'`. Fixed. >> Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp:346 >> + // (''), which represent a literal single quote, either inside or outside quoted text. > > This is okay but since the last three sentences are intended as a bullet list, it seems like you should write it as one. Fixed. Committed r281688 (241038@main): <https://commits.webkit.org/241038@main> |