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

Don't convert custom calendar fields to integers #1053

Merged
merged 1 commit into from
Oct 26, 2020

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented Oct 24, 2020

Only the built-in fields (year through nanosecond, and the plural names
for Duration) should be converted to integers. Custom calendar fields
should not have any type conversion performed on them.

Closes: #1045

Only the built-in fields (year through nanosecond, and the plural names
for Duration) should be converted to integers. Custom calendar fields
should not have any type conversion performed on them.

Closes: #1045
@codecov
Copy link

codecov bot commented Oct 24, 2020

Codecov Report

Merging #1053 into main will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1053      +/-   ##
==========================================
+ Coverage   94.29%   94.33%   +0.04%     
==========================================
  Files          18       18              
  Lines        6675     6694      +19     
  Branches      999     1000       +1     
==========================================
+ Hits         6294     6315      +21     
+ Misses        374      372       -2     
  Partials        7        7              
Flag Coverage Δ
#test262 48.02% <60.00%> (+0.01%) ⬆️
#tests 90.50% <100.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
polyfill/lib/ecmascript.mjs 96.08% <100.00%> (+0.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f24565f...e3986ee. Read the comment docs.

Comment on lines +63 to +83
const BUILTIN_FIELDS = new Set([
'year',
'month',
'day',
'hour',
'minute',
'second',
'millisecond',
'microsecond',
'nanosecond',
'years',
'months',
'weeks',
'days',
'hours',
'minutes',
'seconds',
'milliseconds',
'microseconds',
'nanoseconds'
]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Edge case for followup: this doesn't match the spec if calendar.fields returns one of the builtin fields that don't apply to the object in question.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added this question to #1047 for followup, as it seems very similar.

@Ms2ger Ms2ger merged commit a3606c3 into main Oct 26, 2020
@Ms2ger Ms2ger deleted the 1045-custom-calendar-fields branch October 26, 2020 09:45
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.

Don't convert custom fields from calendar.fields() to integers
2 participants