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

  Changed paths:
    A JSTests/stress/temporal-plain-year-month.js
    M JSTests/stress/temporal-zoned-datetime-until-since.js
    M Source/JavaScriptCore/runtime/TemporalCalendar.cpp
    M Source/JavaScriptCore/runtime/TemporalCalendar.h
    M Source/JavaScriptCore/runtime/TemporalObject.cpp
    M Source/JavaScriptCore/runtime/TemporalObject.h
    M Source/JavaScriptCore/runtime/TemporalPlainDate.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainDate.h
    M Source/JavaScriptCore/runtime/TemporalPlainDatePrototype.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainDateTimePrototype.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainMonthDay.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainTime.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainYearMonth.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainYearMonth.h
    M Source/JavaScriptCore/runtime/TemporalPlainYearMonthConstructor.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainYearMonthPrototype.cpp
    M Source/JavaScriptCore/runtime/TemporalZonedDateTimePrototype.cpp
    M Source/JavaScriptCore/runtime/temporal/core/CalendarFields.cpp
    M Source/JavaScriptCore/runtime/temporal/core/CalendarICUBridge.cpp

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

Reviewed by Yusuke Suzuki.

Fixes five PYM correctness bugs and consolidates the helper layers to
match the spec AOs.

Bugs fixed:
1. PYM.toPlainDate({day: 0|negative|NaN|Infinity}) silently constrained
   to day 1 instead of throwing RangeError.
2. PYM.from({year: 275761, ...}) hit a debug assertion in PlainDate's
   ctor because the range check ran after construction.
3. Same ordering bug in PD.from ISO path via dateFromFields.
4. Chinese M{n}L + {years:1} into a non-leap year constrained to M12
   instead of the base month M{n}. setCalendarToMonthCode now uses the
   codePointCompare early-stop that its siblings already use.
5. Non-ISO PYM.from({era, eraYear}) without a month silently defaulted
   to month 1 instead of throwing TypeError.

Refactoring:
- rejectObjectWithCalendarOrTimeZone renamed to isPartialTemporalObject
  and rewritten to match the spec AO exactly. All six .with() call
  sites converted.
- Consolidated PYM.until/since into one static
  differenceTemporalPlainYearMonth<op> template in the prototype file,
  removing the four-layer pipeline.
- Inlined single-caller helpers: PYM::with, PD::with, fromYearMonthString,
  PD::toDay. Removed dead PD::toYearMonth.
- Renamed AddOrSubtract template to addDurationToYearMonth and fixed
  spec-step annotations across .with, .add/.subtract, and .until/.since.

Test: JSTests/stress/temporal-plain-year-month.js
Canonical link: https://commits.webkit.org/316777@main



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

Reply via email to