Open
Bug 1973064
Opened 6 days ago
Updated 6 days ago
Require strict matching with a precise ZonedDateTime offset
Categories
(Core :: JavaScript: Standard Library, task)
Core
JavaScript: Standard Library
Tracking
()
ASSIGNED
People
(Reporter: anba, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Implement the changes from https://github.com/tc39/proposal-temporal/pull/3107.
Assignee | ||
Comment 1•6 days ago
|
||
Part 2 needs another bool
flag to track if an offset time zone has sub-minute
precision. Adding this flag directly to ParsedZonedDateTime
leads to the
following possible states:
ParsedZonedDateTime::hasOffset
istrue
, then
a.ParsedZonedDateTime::timeZoneOffset
contains the offset.
b.ParsedZonedDateTime::hasOffsetSubminutePrecision
istrue
if the offset
has sub-minute precision. Otherwise the field isfalse
.
c.ParsedZonedDateTime::isUTC
is alwaysfalse
.ParsedZonedDateTime::isUTC
istrue
, then
a.ParsedZonedDateTime::timeZoneOffset
is unused.
b.ParsedZonedDateTime::hasOffsetSubminutePrecision
is unused.
c.ParsedZonedDateTime::hasOffset
is alwaysfalse
.ParsedZonedDateTime::hasOffset
andParsedZonedDateTime::isUTC
arefalse
,
a.ParsedZonedDateTime::timeZoneOffset
is unused.
b.ParsedZonedDateTime::hasOffsetSubminutePrecision
is unused.- And other combination is an invalid state.
This approach has the downside that it's possible to create invalid states and
it's not directly clear which flag controls which other fields are active. Using
MaybeOneOf
avoids these issues.
Assignee | ||
Comment 2•6 days ago
|
||
Implement the actual changes from https://github.com/tc39/proposal-temporal/pull/3107.
You need to log in
before you can comment on or make changes to this bug.
Description
•