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

Editorial: Next batch of editorial issues #3053

Merged
merged 6 commits into from
Dec 6, 2024
Merged

Editorial: Next batch of editorial issues #3053

merged 6 commits into from
Dec 6, 2024

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented Dec 5, 2024

DifferenceISODateTime asserts that the ISO Date-Time Records passed to it
are within limits. Previously there were two places where this was not
guaranteed to be the case. Add checks that throw RangeError so the
assertion is not hit.

Closes: #3015
The default formatter would look for a property called _repr_, which does
not exist, and therefore would be confusingly formatted as "undefined".
Instead, delegate to the original Intl.DateTimeFormat's util.inspect
output.
In a94a793 the desired behaviour when formatting Temporal objects was
accidentally applied to formatting Date objects. So

new Date().toLocaleDateString([],  { hour: "numeric" });

would result in bestFormat being null, and according to the type assertion
of the Intl.DateTimeFormat [[DateTimeFormat]] internal slot, that is not
possible.

Checking that _inherit_ = ~relevant~ here ensures the new behaviour is
only applied to Temporal objects, and the type assertion is not hit.

See: #3049
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.73%. Comparing base (728beeb) to head (78a10fe).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3053   +/-   ##
=======================================
  Coverage   95.73%   95.73%           
=======================================
  Files          21       21           
  Lines        9705     9716   +11     
  Branches     1742     1742           
=======================================
+ Hits         9291     9302   +11     
  Misses        363      363           
  Partials       51       51           

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

@ptomato
Copy link
Collaborator Author

ptomato commented Dec 5, 2024

cc @anba @trflynn89

Some of the DateTimeFormat internal slots may contain null instead of a
DateTime Format Record, if no relevant fields were given. That needs to
be reflected in the return type of this operation.
Copy link
Collaborator

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

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

Thanks!

@Ms2ger Ms2ger merged commit 6800295 into main Dec 6, 2024
10 checks passed
@Ms2ger Ms2ger deleted the editorial branch December 6, 2024 11:12
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