Skip to content

Normative: Fix TemporalCalendarString ambiguity#2394

Merged
ptomato merged 2 commits into
tc39:mainfrom
Aditi-1400:fix-temporalcalendarstring-ambiguity
Sep 13, 2022
Merged

Normative: Fix TemporalCalendarString ambiguity#2394
ptomato merged 2 commits into
tc39:mainfrom
Aditi-1400:fix-temporalcalendarstring-ambiguity

Conversation

@Aditi-1400

Copy link
Copy Markdown
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

codecov Bot commented Aug 30, 2022

Copy link
Copy Markdown

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

@linusg linusg left a comment

Copy link
Copy Markdown
Member

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.

Comment thread spec/abstractops.html Outdated
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

@ptomato ptomato left a comment

Copy link
Copy Markdown
Collaborator

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!

Comment thread spec/abstractops.html Outdated
Comment thread spec/abstractops.html Outdated
@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

ptomato commented Sep 13, 2022

Copy link
Copy Markdown
Collaborator

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