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)

task

Tracking

()

ASSIGNED

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

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:

  1. ParsedZonedDateTime::hasOffset is true, then
    a. ParsedZonedDateTime::timeZoneOffset contains the offset.
    b. ParsedZonedDateTime::hasOffsetSubminutePrecision is true if the offset
    has sub-minute precision. Otherwise the field is false.
    c. ParsedZonedDateTime::isUTC is always false.
  2. ParsedZonedDateTime::isUTC is true, then
    a. ParsedZonedDateTime::timeZoneOffset is unused.
    b. ParsedZonedDateTime::hasOffsetSubminutePrecision is unused.
    c. ParsedZonedDateTime::hasOffset is always false.
  3. ParsedZonedDateTime::hasOffset and ParsedZonedDateTime::isUTC are false,
    a. ParsedZonedDateTime::timeZoneOffset is unused.
    b. ParsedZonedDateTime::hasOffsetSubminutePrecision is unused.
  4. 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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: