Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 897d634c31e79c891729c5b3bfe1e108ade8cbd9
https://github.com/WebKit/WebKit/commit/897d634c31e79c891729c5b3bfe1e108ade8cbd9
Author: Yijia Huang <[email protected]>
Date: 2026-06-17 (Wed, 17 Jun 2026)
Changed paths:
A JSTests/stress/temporal-instant-totemporalinstant.js
M Source/JavaScriptCore/runtime/ISO8601.cpp
M Source/JavaScriptCore/runtime/ISO8601.h
M Source/JavaScriptCore/runtime/TemporalInstant.cpp
M Source/JavaScriptCore/runtime/TemporalInstant.h
M Source/JavaScriptCore/runtime/TemporalInstantConstructor.cpp
M Source/JavaScriptCore/runtime/TemporalInstantPrototype.cpp
M Source/JavaScriptCore/runtime/TemporalNow.cpp
Log Message:
-----------
[JSC][Temporal] Align Temporal.Instant with spec abstract operations
https://bugs.webkit.org/show_bug.cgi?id=317224
rdar://179844859
Reviewed by Yusuke Suzuki.
Refactor Temporal.Instant for 1:1 alignment with the Stage 4 spec
abstract operations. Each constructor static, prototype method, and
helper maps step-by-step to its spec citation. Removed:
TemporalInstant::from / parse / fromObject / tryCreateIfValid / member
toString(JSGlobalObject*, JSValue) / member difference / member round,
plus ISO8601::parseInstant — each inlined at the single call site that
owns the spec algorithm.
- TemporalInstant::toInstant implements ToTemporalInstant directly. The
slot path now returns a NEW instance via CreateTemporalInstant (spec
contract; previously returned same identity). Grammar restriction for
TemporalInstantString (Time-required, Offset/Z-required) is layered on
top of parseCalendarDateTime since JSC lacks a unified ParseISODateTime.
- In ToTemporalInstant, BalanceISODateTime + GetUTCEpochNanoseconds
collapse into ExactTime::fromISOPartsAndOffset, and CheckISODaysRange
+ IsValidEpochNanoseconds collapse into ExactTime::isValid(). Both are
observably equivalent.
- Prototype methods extract two abstract operations as templates:
addDurationToInstant<AddInstantOperation> drives add/subtract, and
differenceTemporalInstant<DifferenceOperation> drives until/since with
NegateRoundingMode applied at extractDifferenceOptions for SINCE.
- FIXME notes the parser-architecture gap: JSC has four parser entry
points covering subsets of the spec's single ParseISODateTime, forcing
consumers to re-implement production guards. Future work should
introduce ParseISODateTime(string, ProductionMask) for 1:1 spec parity.
Test: JSTests/stress/temporal-instant-totemporalinstant.js
Canonical link: https://commits.webkit.org/315377@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications