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

  Changed paths:
    A JSTests/stress/temporal-construct-newtarget-prototype-order.js
    M Source/JavaScriptCore/runtime/TemporalDuration.cpp
    M Source/JavaScriptCore/runtime/TemporalDuration.h
    M Source/JavaScriptCore/runtime/TemporalDurationConstructor.cpp
    M Source/JavaScriptCore/runtime/TemporalDurationPrototype.cpp
    M Source/JavaScriptCore/runtime/TemporalInstant.cpp
    M Source/JavaScriptCore/runtime/TemporalInstant.h
    M Source/JavaScriptCore/runtime/TemporalInstantConstructor.cpp
    M Source/JavaScriptCore/runtime/TemporalObject.h
    M Source/JavaScriptCore/runtime/TemporalPlainDate.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainDate.h
    M Source/JavaScriptCore/runtime/TemporalPlainDateConstructor.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainDatePrototype.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainDateTime.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainDateTime.h
    M Source/JavaScriptCore/runtime/TemporalPlainDateTimeConstructor.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainDateTimePrototype.cpp
    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/TemporalPlainTime.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainTime.h
    M Source/JavaScriptCore/runtime/TemporalPlainTimeConstructor.cpp
    M Source/JavaScriptCore/runtime/TemporalPlainTimePrototype.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/TemporalZonedDateTime.cpp
    M Source/JavaScriptCore/runtime/TemporalZonedDateTime.h
    M Source/JavaScriptCore/runtime/TemporalZonedDateTimeConstructor.cpp
    M Source/JavaScriptCore/runtime/TemporalZonedDateTimePrototype.cpp

  Log Message:
  -----------
  [JSC][Temporal] Fix constructor newTarget.prototype ordering and unify 
CreateTemporalX helpers
https://bugs.webkit.org/show_bug.cgi?id=321041
rdar://184072358

Reviewed by Yusuke Suzuki.

Every CreateTemporalX AO validates its slots before 
OrdinaryCreateFromConstructor,
whose Get(NewTarget, "prototype") is observable. All eight Temporal constructors
derived their Structure on entry, so Reflect.construct with a throwing 
`prototype`
accessor got that error instead of the mandated RangeError.

The helpers now take a TemporalNewTarget rather than a Structure*, making the 
wrong
order unrepresentable, and are renamed after their AOs as free functions —
createTemporalDate, createTemporalZonedDateTime and so on. `try*` in WebKit 
means
"returns null without throwing", the opposite of these.

Two bugs found on the way: ZonedDateTime.prototype.with open-coded
InterpretISODateTimeOffset without its CheckISODaysRange and 
IsValidEpochNanoseconds
steps, so an offset at the epoch boundary produced an out-of-range 
ZonedDateTime; and
isValidPlainDateOrThrow threw through its own ThrowScope, leaving the caller's
unchecked under --validateExceptionChecks.

Also folds CalendarID into CreateTemporalYearMonth/MonthDay, adds the missing
CreateTemporalInstant, and corrects the step annotations in all eight.

Test: JSTests/stress/temporal-construct-newtarget-prototype-order.js
Canonical link: https://commits.webkit.org/318635@main



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

Reply via email to