Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 75d9be0204db1a1c7c0cfd3ba63f70afaf53ef01
https://github.com/WebKit/WebKit/commit/75d9be0204db1a1c7c0cfd3ba63f70afaf53ef01
Author: Yijia Huang <[email protected]>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
A JSTests/stress/temporal-now-constructor-cold-init.js
M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
M Source/JavaScriptCore/runtime/JSGlobalObject.h
M Source/JavaScriptCore/runtime/TemporalDurationConstructor.cpp
M Source/JavaScriptCore/runtime/TemporalInstantConstructor.cpp
M Source/JavaScriptCore/runtime/TemporalObject.cpp
M Source/JavaScriptCore/runtime/TemporalPlainDateConstructor.cpp
M Source/JavaScriptCore/runtime/TemporalPlainDateTimeConstructor.cpp
M Source/JavaScriptCore/runtime/TemporalPlainMonthDayConstructor.cpp
M Source/JavaScriptCore/runtime/TemporalPlainTimeConstructor.cpp
M Source/JavaScriptCore/runtime/TemporalPlainYearMonthConstructor.cpp
M Source/JavaScriptCore/runtime/TemporalZonedDateTimeConstructor.cpp
Log Message:
-----------
[JSC][Temporal] Fix Temporal.<Type>.prototype.constructor before first access
https://bugs.webkit.org/show_bug.cgi?id=318990
rdar://181842591
Reviewed by Yusuke Suzuki.
Before Temporal.<Type> was accessed as a property for the first time,
Temporal.Now.plainDateISO().constructor.name returned "Object" instead
of "PlainDate". The 8 Temporal types used LazyProperty<Structure>, which
creates only the prototype; prototype.constructor was set inside each
constructor's finishCreation, which ran only when Temporal.<Type> was
touched.
Switch to LazyClassStructure so setConstructor sets prototype.constructor
eagerly. Drop the now-redundant write from each constructor's finishCreation.
Test: JSTests/stress/temporal-now-constructor-cold-init.js
Canonical link: https://commits.webkit.org/316898@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications