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

Normative: Fix TemporalCalendarString ambiguity #2394

Merged
merged 2 commits into from
Sep 13, 2022

Conversation

Aditi-1400
Copy link
Collaborator

This PR fixes issue #2165

  • While working on this, we realised that CalendarName had ambiguities with not just CalendarDateTime, but also with other sub-productions (CalendarTime, DateSpecYearMonth and DateSpecMonthDay). So it was better to remove CalendarName sub-production from TemporalCalendarString.
  • ParseTemporalCalendarString was modified to use ParseISODateTime rather than TemporalCalendarString so that when ParseISODateTime is later updated to implement the conclusions of IETF draft, the changes would automatically apply to calendar strings.
  • The only caller of ParseTemporalCalendarString is in ToTemporalCalendar, which already checks for IsBuiltinCalendar before calling ParseTemporalCalendarString. So, one of those steps (checking IsBuiltinCalendar first, or parsing as |CalendarName|) is redundant. Removing the first IsBuiltinCalendar check is more in line with the normative change we wanted to make here (first parse as ISO string, then as calendar name).

Thanks @ptomato for all the help! :)

@codecov
Copy link

codecov bot commented Aug 30, 2022

Codecov Report

Merging #2394 (b2cc89e) into main (b4d9abc) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2394   +/-   ##
=======================================
  Coverage   95.03%   95.03%           
=======================================
  Files          20       20           
  Lines       10818    10818           
  Branches     1925     1925           
=======================================
  Hits        10281    10281           
  Misses        503      503           
  Partials       34       34           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

linusg added a commit to linusg/serenity that referenced this pull request Aug 30, 2022
This is a normative change in the Temporal spec.

See: tc39/proposal-temporal#2394
Copy link
Member

@linusg linusg left a comment

Choose a reason for hiding this comment

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

Many thanks for investigating and fixing this, I can confirm that implementing this change fixes 62 test262 Temporal tests (intl402/built-ins combined) on our end, with no regressions 🎉

One small suggestion.

spec/abstractops.html Outdated Show resolved Hide resolved
linusg added a commit to linusg/serenity that referenced this pull request Aug 30, 2022
This is a normative change in the Temporal spec.

See: tc39/proposal-temporal#2394
Copy link
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

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

I think it's a good solution. Thanks!

spec/abstractops.html Outdated Show resolved Hide resolved
spec/abstractops.html Outdated Show resolved Hide resolved
@Aditi-1400 Aditi-1400 force-pushed the fix-temporalcalendarstring-ambiguity branch from 29a6773 to b2cc89e Compare September 1, 2022 11:21
linusg added a commit to linusg/serenity that referenced this pull request Sep 2, 2022
This is a normative change in the Temporal spec.

See: tc39/proposal-temporal#2394
linusg added a commit to linusg/serenity that referenced this pull request Sep 2, 2022
This is a normative change in the Temporal spec.

See: tc39/proposal-temporal#2394
linusg added a commit to linusg/serenity that referenced this pull request Sep 3, 2022
This is a normative change in the Temporal spec.

See: tc39/proposal-temporal#2394
linusg added a commit to linusg/serenity that referenced this pull request Sep 3, 2022
This is a normative change in the Temporal spec.

See: tc39/proposal-temporal#2394
@ptomato
Copy link
Collaborator

ptomato commented Sep 13, 2022

This achieved consensus at the September 2022 TC39 meeting. It already is covered in test262.

@ptomato ptomato merged commit b73aea7 into tc39:main Sep 13, 2022
balusch pushed a commit to balusch/v8 that referenced this pull request Sep 24, 2022
Sync with tc39/proposal-temporal#2394
to fix  TemporalCalendarString ambiguity issues


Spec text:
https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalcalendarstring
https://tc39.es/proposal-temporal/#sec-temporal-totemporalcalendar

Bug: v8:11544
Change-Id: I31d0255e55d1a432681fd060cf4f841cb1479480
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3901196
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83409}
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.

3 participants