Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch of fixes for editorial issues #2735

Merged
merged 10 commits into from
Jan 8, 2024
Merged

Batch of fixes for editorial issues #2735

merged 10 commits into from
Jan 8, 2024

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented Dec 13, 2023

Most of these were recently spotted by @anba (cc and thanks!)

This language should hopefully make it clearer that _offsetOption_ only
has any effect when _offsetBehaviour_ is ~option~.
05f7a11 (part of #2670)
inadvertently made an observable change. This restores the previous
observable semantics.

Thanks to Anba for spotting this.

Closes: #2721
Also, document the 24-hour UTC offset limitation, which led us to remove
this example, in the docs for getOffsetNanosecondsFor.

Closes: #2725
This exact same assertion is also repeated at the top of the AO.

Closes: #2731
The calendar record may come from either zonedRelativeTo or
plainRelativeTo.

Closes: #2734
This step was missing a field from the returned Record. Also reorder the
fields for consistency with the other steps.

Closes: #2732
The calendar is a String here, so the method can be looked up infallibly.

Closes: #2730
GetUTCEpochNanoseconds has an assertion that MakeDate, MakeTime, and
MakeDay all result in a finite value. However, several places call
GetUTCEpochNanoseconds with a year value that may be excessively large,
notably from parsing an ISO string such as +999999-01-01, which would
cause that assertion to be hit.

Add checks in the appropriate places to make sure that the year value is
not excessively large.

Closes: #2729
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6e12d03) 96.38% compared to head (f46e302) 96.38%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2735   +/-   ##
=======================================
  Coverage   96.38%   96.38%           
=======================================
  Files          21       21           
  Lines       12444    12444           
  Branches     2250     2250           
=======================================
  Hits        11994    11994           
  Misses        395      395           
  Partials       55       55           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -1122,10 +1122,10 @@ <h1>
1. Assert: TimeZoneMethodsRecordHasLookedUp(_timeZoneRec_, ~getOffsetNanosecondsFor~) is *true*.
1. Assert: TimeZoneMethodsRecordHasLookedUp(_timeZoneRec_, ~getPossibleInstantsFor~) is *true*.
1. Let _dateTime_ be ? CreateTemporalDateTime(_year_, _month_, _day_, _hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_, *"iso8601"*).
1. If _offsetBehaviour_ is ~wall~ or _offsetOption_ is *"ignore"*, then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not obvious to me why this is correct.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was something that came up in a review of the test262 tests with Cam. It's confusing that offsetOption has no effect, unless offsetBehaviour is ~option~. (To realize that, you have to look long and hard at all callers of this operation, which is not good for reading comprehension.) This change was intended to make it clearer on a first read.

@Ms2ger Ms2ger merged commit c4b17d8 into main Jan 8, 2024
9 checks passed
@Ms2ger Ms2ger deleted the editorial branch January 8, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants