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

  Changed paths:
    A JSTests/stress/temporal-plain-month-day.js
    M Source/JavaScriptCore/API/tests/TemporalCoreTest.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainDate.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainDate.h
    M Source/JavaScriptCore/runtime/TemporalPlainMonthDay.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainMonthDay.h
    M Source/JavaScriptCore/runtime/TemporalPlainMonthDayConstructor.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainMonthDayPrototype.cpp
    M Source/JavaScriptCore/runtime/temporal/core/CalendarFields.cpp
    M Source/JavaScriptCore/runtime/temporal/core/CalendarFields.h

  Log Message:
  -----------
  [JSC][Temporal] Fix PlainMonthDay bugs and simplify helpers
https://bugs.webkit.org/show_bug.cgi?id=318977
rdar://181832650

Reviewed by Yusuke Suzuki.

Fixes six PMD correctness bugs uncovered by a full audit against V8
and temporal_rs.

Bugs fixed:
.toPlainDate({era, eraYear}) threw TypeError on era-based calendars.
Rewrote handler to read era/eraYear/year per PrepareCalendarFields
<year> + CalendarExtraFields expansion.

Non-ISO non-lunisolar .with()/.from() silently accepted disagreeing
month + monthCode. Added consistency check in all three non-ISO
branches of dateFromFields/yearMonthFromFields/monthDayFromFields.

`new PMD(6, 15, "iso8601", 275761)` was a debug-assert crash.
Pre-validate year+date before constructing ISO8601::PlainDate.

Non-spec `argumentCount < 2` guard preempted spec's
ToIntegerWithTruncation(undefined) -> NaN -> RangeError path.

PMD.from({era, eraYear, month, day}) silently required monthCode.
Relaxed check to accept era+eraYear; std::optional<int32_t>
localYear matches temporal_rs's DateFields::try_from shape.

PMD.from(nonISOPMD) silently dropped the source calendar because
the funcFrom fast-path called create() without setCalendarID().
Removed the redundant fast-path — PMD::from handles clone correctly.

Cleanups:
inlined TemporalPlainMonthDay::with, fromMonthDayString, and
PMD::toString(options) into sole callers. Removed dead
plainMonthDayToPlainDate (core) and TemporalPlainDate::toYear.

Tests:
JSTests/stress/temporal-plain-month-day.js
Source/JavaScriptCore/API/tests/TemporalCoreTest.cpp

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



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

Reply via email to