Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b2ec9a4586eec8c6fd9d9871980b6ddc525174d3
      
https://github.com/WebKit/WebKit/commit/b2ec9a4586eec8c6fd9d9871980b6ddc525174d3
  Author: Yijia Huang <[email protected]>
  Date:   2026-08-08 (Sat, 08 Aug 2026)

  Changed paths:
    A JSTests/stress/intl-datetimeformat-era-override-parts.js
    M Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
    M Source/JavaScriptCore/runtime/temporal/core/CalendarICUBridge.cpp

  Log Message:
  -----------
  [JSC][Intl] formatToParts must emit the era separator that format() inserts
https://bugs.webkit.org/show_bug.cgi?id=321347
rdar://184382546

Reviewed by Yusuke Suzuki.

ICU emits no era name for coptic dates before Anno Martyrum or islamic-* dates
before the Hijra, so both format() overloads synthesize one. format() also
inserts a separating space before the appended era; formatToParts() did not, so
concatenating the parts stopped reproducing format() — 90 of 720 locale and
option combinations, for example ja-JP coptic {era:"short"} formatting
"185/5/7 Anno Martyrum" against joined parts "185/5/7Anno Martyrum".

The separator stays conditional. Where ICU leaves a trailing space in the empty
era slot, the parts loop already emits it as a literal, so synthesizing one
unconditionally would double it. jsSingleCharacterString rather than
jsNontrivialString, which asserts a length above one.

Only the appended-era path is affected; where ICU emits an era field its own
pattern supplies the separator.

Also correct calendarUsesISOFallbackForExtremeYear's comment: ±10000 is icu4x's
WELL_BEHAVED_ASTRONOMICAL_RANGE, not a claim that ICU is accurate within it —
ICU's chinese winter-solstice table covers only gregorian 1900-2100.

Test: JSTests/stress/intl-datetimeformat-era-override-parts.js
Canonical link: https://commits.webkit.org/318847@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to