Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a1e2020dffa247ed280569b4f35dfaf230e75948
      
https://github.com/WebKit/WebKit/commit/a1e2020dffa247ed280569b4f35dfaf230e75948
  Author: Sosuke Suzuki <[email protected]>
  Date:   2025-12-03 (Wed, 03 Dec 2025)

  Changed paths:
    M Source/JavaScriptCore/runtime/TemporalCalendar.cpp

  Log Message:
  -----------
  [JSC] Replace `isValidISODate` with `isDateTimeWithinLimits` in 
`TemporalCalendar::monthDayFromFields`
https://bugs.webkit.org/show_bug.cgi?id=303163

Reviewed by Yusuke Suzuki.

The `isValidISODate` check after `regulateISODate` is redundant because:

- When overflow is `Reject`, `regulateISODate` already calls `isValidISODate`
  and returns `std::nullopt` if invalid.
- When overflow is `Constrain`, the month and day are clamped to valid ranges,
  so `isValidISODate` will always return true.

However, according to the spec, `monthDayFromFields` should call
`ISODateWithinLimits` to check that the year is within range.
This is necessary for future non-ISO calendar support where the
reference year may be invalid in rare cases.

See: https://github.com/tc39/proposal-temporal/issues/2997

* Source/JavaScriptCore/runtime/TemporalCalendar.cpp:
(JSC::TemporalCalendar::monthDayFromFields):

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



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

Reply via email to