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

Test that non-string Temporal.TimeZone IDs will throw #3881

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

justingrant
Copy link
Contributor

@justingrant justingrant commented Jul 22, 2023

This PR fills a test hole found by Codecov: we weren't checking for the case of a custom time zone whose id property returns a non-string value.

The id property is only read in a few places, all on the ZonedDateTime prototype: until, since, equals, toString, toLocaleString, toJSON, and timeZoneId.

Note that the same test gap seems to exist for custom calendars too, so a future PR will be needed to fill that gap.

@justingrant justingrant requested a review from a team as a code owner July 22, 2023 05:29
@justingrant justingrant force-pushed the custom-timezone-id-must-be-string branch 2 times, most recently from 68c0f0e to b672404 Compare July 22, 2023 05:47
Copy link
Contributor

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

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

Thank you!

This commit fills a test hole found by Codecov: we weren't checking for
the case of a custom time zone whose `id` property returns a non-string
value.

Note that the `id` property is only read in a few places, all on the
ZonedDateTime prototype: `until`, `since`, `equals`, `toString`,
`toLocaleString`, `toJSON`, and `timeZoneId`.
@Ms2ger Ms2ger force-pushed the custom-timezone-id-must-be-string branch from b672404 to 6fc6319 Compare July 25, 2023 07:27
@Ms2ger Ms2ger enabled auto-merge (rebase) July 25, 2023 07:28
@Ms2ger Ms2ger merged commit e8bbfe7 into tc39:main Jul 25, 2023
9 checks passed
@justingrant
Copy link
Contributor Author

Note that the same test gap seems to exist for custom calendars too, so a future PR will be needed to fill that gap.

FYI @ptomato: there may be a test gap for non-string custom calendar IDs. Where is the best place to record that this gap exists? Issue here in Test262 repo? In proposal-temporal repo? Somewhere else? I probably won't be able to PR that, but at least wanted to record that the gap (probably) exists.

@Ms2ger
Copy link
Contributor

Ms2ger commented Jul 27, 2023

I created one here

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.

None yet

2 participants