Summary: | [JSC] Use -2 for grouping options in IntlRelativeTimeFormat | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||
Component: | New Bugs | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | ews-watchlist, keith_miller, mark.lam, msaboff, ross.kirsling, saam, tzagallo, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 213425 | ||||||||
Attachments: |
|
Description
Yusuke Suzuki
2020-08-30 00:01:00 PDT
Created attachment 407563 [details]
Patch
Comment on attachment 407563 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407563&action=review > Source/JavaScriptCore/runtime/IntlRelativeTimeFormat.cpp:150 > + // Align to IntlNumberFormat's default. > + unum_setAttribute(m_numberFormat.get(), UNUM_MIN_INTEGER_DIGITS, 1); > + unum_setAttribute(m_numberFormat.get(), UNUM_MIN_FRACTION_DIGITS, 0); > + unum_setAttribute(m_numberFormat.get(), UNUM_MAX_FRACTION_DIGITS, 3); > + unum_setAttribute(m_numberFormat.get(), UNUM_GROUPING_USED, true); Do these need to be set explicitly? Comment on attachment 407563 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407563&action=review >> Source/JavaScriptCore/runtime/IntlRelativeTimeFormat.cpp:150 >> + unum_setAttribute(m_numberFormat.get(), UNUM_GROUPING_USED, true); > > Do these need to be set explicitly? Currently, setting these options to align well to the spec (https://tc39.es/ecma402/#sec-InitializeRelativeTimeFormat uses Intl.NumberFormat). I think this is safer, because ICU could change default values. Comment on attachment 407563 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407563&action=review > Source/JavaScriptCore/runtime/IntlRelativeTimeFormat.cpp:162 > + unum_setAttribute(m_numberFormat.get(), UNUM_GROUPING_SIZE, useLocaleDefault); > + unum_setAttribute(m_numberFormat.get(), UNUM_SECONDARY_GROUPING_SIZE, useLocaleDefault); Er wait, one more question. Does that enum value really apply to these two attributes as well? It's not very clear from the linked ICU commit. Comment on attachment 407563 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407563&action=review >> Source/JavaScriptCore/runtime/IntlRelativeTimeFormat.cpp:162 >> + unum_setAttribute(m_numberFormat.get(), UNUM_SECONDARY_GROUPING_SIZE, useLocaleDefault); > > Er wait, one more question. Does that enum value really apply to these two attributes as well? It's not very clear from the linked ICU commit. Yes, all three are required. See ICU code for fGrouping1, fGrouping2, and fMinGrouping. Created attachment 407576 [details]
Patch
Patch for landing
ChangeLog entry in JSTests/ChangeLog contains OOPS!. Committed r266341: <https://trac.webkit.org/changeset/266341> |