Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2fb282a825385d9f53f09b6adc07b18f19203276
      
https://github.com/WebKit/WebKit/commit/2fb282a825385d9f53f09b6adc07b18f19203276
  Author: Yijia Huang <[email protected]>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    A JSTests/stress/temporal-calendar-icu-bridge-non-iso.js
    M Source/JavaScriptCore/API/tests/TemporalCoreTest.cpp
    M Source/JavaScriptCore/runtime/temporal/core/CalendarICUBridge.cpp

  Log Message:
  -----------
  [JSC][Temporal] Fix non-ISO Calendar bugs in CalendarICUBridge
https://bugs.webkit.org/show_bug.cgi?id=319278
rdar://182118211

Reviewed by Yusuke Suzuki.

Four bugs found by cross-checking against temporal_rs and icu4x:

1. Coptic / Ethiopic `am` era was mapped to ICU era 0 (before-AM); the
correct value is 1 (AM). Dates constructed via era:"am" ended up ~5500
years off.

2. Japanese / ROC / Buddhist year/month/leap-year accessors used ICU's
Julian arithmetic for pre-1582 dates (ICU4C rejects
ucal_setGregorianChange on these derived calendars). Spec requires
proleptic Gregorian; route those accessors through the base Gregorian
calendar via gregorianArithmeticCalendarFor().

3. Buddhist year: ICU's UCAL_EXTENDED_YEAR is the Gregorian year, not the
BE year (BE = Gregorian + 543). Read/write paths now use UCAL_YEAR
(which ICU exposes as BE for Buddhist).

4. Buddhist ecmaReferenceYear: was 1972 (Gregorian-year convention), but
post-fix (3) the Buddhist write path expects BE, so 1972 was interpreted
as BE and resolved to Gregorian 1429 (non-leap), regressing
intl402/.../constrain-to-leap-day.js. Use 2515 BE (= Gregorian 1972,
leap), matching the calendar-native-year convention already used for
ROC (61) and Indian.

Tests: JSTests/stress/temporal-calendar-icu-bridge-non-iso.js
       Source/JavaScriptCore/API/tests/TemporalCoreTest.cpp

Canonical link: https://commits.webkit.org/317087@main



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

Reply via email to