-
Notifications
You must be signed in to change notification settings - Fork 147
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
Update validation, coercion for all built-in fields. #1319
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1319 +/- ##
==========================================
- Coverage 95.61% 94.78% -0.83%
==========================================
Files 19 19
Lines 9341 9561 +220
Branches 1440 1493 +53
==========================================
+ Hits 8931 9062 +131
- Misses 404 489 +85
- Partials 6 10 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
(Validation in getter prototypes is also TODO, but shouldn't be anything surprising given the table) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the removal of ToRecord is an improvement in particular!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review here-- will finish reviewing later today but wanted to get you initial notes ASAP.
6406cc1
to
e7e9052
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to separate out the validation changes from the addition of era/eraYear? I think since the latter is newer in this PR, it might take another round of review, whereas the validation changes are basically ready to go with minor comments. The changes for monthCode in #1203 also need the validation, so it would be good to get that merged sooner rather than later.
It would be harder to pull out era/eraYear because the current implementation contains |
736264e
to
5d4f375
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments.
b65f312
to
7b5d4cc
Compare
7b5d4cc
to
3ff286b
Compare
Do not merge; RFC only in this state
This change does a few other things as well:
era
,eraYear
for all remaining objects.eraYear
/year
split behavior for'gregory'
and'japanese'
calendars (NB: choice of anchor/default era in 'japanese' should be revisited with more cultural context).I only included the specification for the new
PrepareTemporalFields
abstract operation; I'm still refactoring the spec text into all the otherToTemporal*Fields
,ToRelativeTemporalObject
, etc abstract operations and that's messy / incomplete at the moment. However,PrepareTemporalFields
closely matches how ES.ToRecord was used throughout the polyfill already, so this brings the specification and polyfill much closer together.There are a number of questions and FIXME comments; I'm also uncertain if the language I used around abstract operation references in a table is valid specification. Bear with me :) Will finish this up over the next day and change.