-
Notifications
You must be signed in to change notification settings - Fork 156
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
What if calendar.fields() returns "calendar" as one of the fields? #1047
Comments
Also mentioned in #1053 (comment) - what if it returns one of the built-in fields that wasn't in the input array? |
Related is #1054:
{
plainDate: ['era'],
plainYearMonth: ['era'],
// plainMonthDay: undefined,
// plainTime: undefined,
zonedDateTime: ['era'],
plainDateTime: ['era']
}
|
I think we can stick to #1054 for those, the questions above still apply even if those changes are made. |
Pretty sure the answer is that we do something sensible in that case. Verify and close |
It looks like the "fields" method is only invoked from CalendarFields, whose output is always fed to PrepareTemporalFields which propagates it back to end up in CalendarYearMonthFromFields, CalendarMonthDayFromFields, CalendarDateFromFields, or InterpretTemporalDateTimeFields. The first three send fields right back to the corresponding calendar method, while the last sends fields to ToTemporalTimeRecord (which invokes PrepareTemporalFields itself and then looks only for specific fields in the result) and then to the already-covered CalendarDateFromFields. I think we're good. |
Thanks for looking into it. Closing 😄 |
Follow up from #1014 (comment)
This is something we'll probably have to test in the test262 tests, and make sure that something sensible happens.
The text was updated successfully, but these errors were encountered: