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

PlainYearMonth#until and PlainYearMonth#since don't pass in the options argument for DateFromFields #1944

Closed
Lubrsi opened this issue Nov 24, 2021 · 2 comments

Comments

@Lubrsi
Copy link
Contributor

Lubrsi commented Nov 24, 2021

This occurs on steps 16 and 19 of PlainYearMonth#until (https://tc39.es/proposal-temporal/#sec-temporal.plainyearmonth.prototype.until):

16. Let otherDate be ? DateFromFields(calendar, otherFields).
...
19. Let thisDate be ? DateFromFields(calendar, thisFields).

This also occurs on steps 17 and 20 of PlainYearMonth#since (https://tc39.es/proposal-temporal/#sec-temporal.plainyearmonth.prototype.since):

17. Let otherDate be ? DateFromFields(calendar, otherFields).
...
20. Let thisDate be ? DateFromFields(calendar, thisFields).

The current definition of DateFromFields marks options as required and has no fallback value if it's not present (https://tc39.es/proposal-temporal/#sec-temporal-datefromfields):

12.1.24 DateFromFields ( calendar, fields, options )
    1. Assert: Type(calendar) is Object.
    2. Assert: Type(fields) is Object.
    3. Let date be ? Invoke(calendar, "dateFromFields", « fields, options »).
    4. Perform ? RequireInternalSlot(date, [[InitializedTemporalDate]]).
    5. Return date.
@ljharb
Copy link
Member

ljharb commented Nov 24, 2021

DateFromFields also seems to be missing an assertion about the type of options.

@ptomato
Copy link
Collaborator

ptomato commented Nov 24, 2021

I think this is duplicated by #1685, so I'll close it, but please let me know if there's something else that I missed.

@ptomato ptomato closed this as completed Nov 24, 2021
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

No branches or pull requests

3 participants