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: Update calendar data consistency validation #2500

Merged
merged 7 commits into from
Aug 21, 2023

Conversation

gibson042
Copy link
Collaborator

@gibson042 gibson042 commented Feb 9, 2023

Fixes #2497
Fixes #2465
Closes #2466

"era" and "eraYear" are still checked by PrepareTemporalFields in alphabetical order along with other fields when the calendar specifies their relevance, but ensuring both-or-neither and consistency between the pair and "year" is no longer part of the operation (although it remains part of CalendarResolveFields along with similar checks for "month" and "monthCode").

A followup should move Calendar-related operations from ECMA-402 to ECMA-262 after this and #2474... I initially included that here as 13e2c73, but backed it out to avoid potential merge conflicts.

TODO:

  • Update polyfill

@codecov
Copy link

codecov bot commented Feb 9, 2023

Codecov Report

Merging #2500 (ecbe690) into main (1275241) will decrease coverage by 0.01%.
The diff coverage is 95.94%.

@@            Coverage Diff             @@
##             main    #2500      +/-   ##
==========================================
- Coverage   96.08%   96.07%   -0.01%     
==========================================
  Files          20       20              
  Lines       11600    11655      +55     
  Branches     2195     2201       +6     
==========================================
+ Hits        11146    11198      +52     
- Misses        390      393       +3     
  Partials       64       64              
Files Changed Coverage Δ
polyfill/lib/ecmascript.mjs 98.42% <90.62%> (-0.05%) ⬇️
polyfill/lib/calendar.mjs 87.12% <100.00%> (+0.15%) ⬆️
polyfill/lib/plainmonthday.mjs 97.50% <100.00%> (ø)
polyfill/lib/plainyearmonth.mjs 98.27% <100.00%> (ø)

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.

The editorial changes seem good in any case, could we get them in a separate PR?

In particular, "Editorial: Consolidate standard-field Calendar method logic into ECMA-262" is #1418, which I was planning on working on after getting all the normative issues finished. I realize it's later reverted in this PR, but it'd be great to put that work towards addressing that issue in a separate PR!

This looks to be less invasive than I thought it would be, so I'm more positive about it than I expected. It'd be helpful to me, if I could revisit it again once it's rebased.

spec/intl.html Show resolved Hide resolved
spec/calendar.html Outdated Show resolved Hide resolved
spec/abstractops.html Outdated Show resolved Hide resolved
@gibson042
Copy link
Collaborator Author

I rebased on main and extracted the initial sequence of editorial commits into #2506, upon which this PR now sits (diff). Ephemeral consolidation of Calendar method logic into ECMA-262 in 13e2c73 was lost in the process due to merge conflicts, so I'm explicitly mentioning it here.

@gibson042 gibson042 force-pushed the gh-2466-calendar-field-validation branch 2 times, most recently from 22f90a3 to a05869c Compare February 19, 2023 18:04
@gibson042 gibson042 force-pushed the gh-2466-calendar-field-validation branch from a05869c to 8b967f1 Compare February 26, 2023 17:27
@ptomato ptomato force-pushed the gh-2466-calendar-field-validation branch from 8b967f1 to 0fd6708 Compare February 27, 2023 18:31
@ptomato ptomato force-pushed the gh-2466-calendar-field-validation branch from 0fd6708 to 28b99a6 Compare April 18, 2023 19:38
@gibson042 gibson042 force-pushed the gh-2466-calendar-field-validation branch from 28b99a6 to e5fc09d Compare April 19, 2023 14:57
spec/intl.html Outdated Show resolved Hide resolved
ptomato added a commit that referenced this pull request May 18, 2023
This is an editorial change intended to reduce the diff of PR #2500, where
this rename is part of the changes.
ptomato added a commit that referenced this pull request May 19, 2023
This is an editorial change intended to reduce the diff of PR #2500, where
this rename is part of the changes.
@ptomato ptomato mentioned this pull request May 19, 2023
@ptomato ptomato force-pushed the gh-2466-calendar-field-validation branch from e5fc09d to 5580db6 Compare May 19, 2023 17:48
Copy link
Collaborator

@justingrant justingrant 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 this looks good, but I didn't spend enough time with it to be 100% confident so leaving for others to approve. A few minor comments below.

polyfill/lib/calendar.mjs Outdated Show resolved Hide resolved
spec/calendar.html Outdated Show resolved Hide resolved
@ptomato ptomato mentioned this pull request Jul 13, 2023
91 tasks
@justingrant
Copy link
Collaborator

What's the plan with this PR? It's been open for a very long time. Is it still relevant?

@ptomato
Copy link
Collaborator

ptomato commented Aug 14, 2023

What's the plan with this PR? It's been open for a very long time. Is it still relevant?

It's waiting on resolution of #2500 (comment)

@justingrant
Copy link
Collaborator

What's the plan with this PR? It's been open for a very long time. Is it still relevant?

It's waiting on resolution of #2500 (comment)

@gibson042, possible to respond to that comment so we can unblock this? Thx!

@gibson042 gibson042 force-pushed the gh-2466-calendar-field-validation branch 2 times, most recently from b01d958 to 47a285b Compare August 15, 2023 23:20
@gibson042
Copy link
Collaborator Author

Updated and rebased onto main.

spec/calendar.html Outdated Show resolved Hide resolved
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.

Works for me, I'm fine to merge it along with tc39/test262#3835 when other reviewers are satisfied.

polyfill/lib/calendar.mjs Outdated Show resolved Hide resolved
@gibson042 gibson042 force-pushed the gh-2466-calendar-field-validation branch from 47a285b to bf1158f Compare August 17, 2023 15:59
@gibson042
Copy link
Collaborator Author

Rebased.

@gibson042 gibson042 force-pushed the gh-2466-calendar-field-validation branch from bf1158f to 452d115 Compare August 17, 2023 16:06
Copy link
Collaborator

@Aditi-1400 Aditi-1400 left a comment

Choose a reason for hiding this comment

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

Looks good to me! :)

gibson042 and others added 7 commits August 21, 2023 09:18
"era" and "eraYear" are still checked in alphabetical order along with other fields
when the calendar specifies their relevance,
but ensuring both-or-neither and consistency between the pair and "year"
is no longer part of the operation (although it remains part of CalendarResolveFields
along with similar checks for "month" and "monthCode").

Fixes tc39#2465
…ds` algorithm

Keep it in the implementation-defined CalendarFieldDescriptors operation
@ptomato ptomato force-pushed the gh-2466-calendar-field-validation branch from 452d115 to ecbe690 Compare August 21, 2023 16:23
@ptomato ptomato merged commit 4345a8c into tc39:main Aug 21, 2023
9 checks passed
gibson042 added a commit to gibson042/test262 that referenced this pull request Aug 21, 2023
As of tc39/proposal-temporal#2500 ,
year is always optional for the ISO 8601 calendar.
ptomato pushed a commit to gibson042/test262 that referenced this pull request Sep 19, 2023
As of tc39/proposal-temporal#2500 ,
year is always optional for the ISO 8601 calendar.
ptomato pushed a commit to gibson042/test262 that referenced this pull request Sep 28, 2023
As of tc39/proposal-temporal#2500 ,
year is always optional for the ISO 8601 calendar.
gibson042 added a commit to gibson042/test262 that referenced this pull request Oct 26, 2023
As of tc39/proposal-temporal#2500 ,
year is always optional for the ISO 8601 calendar.
gibson042 added a commit to tc39/test262 that referenced this pull request Oct 26, 2023
As of tc39/proposal-temporal#2500 ,
year is always optional for the ISO 8601 calendar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants