Skip to content

Reject IsoDate when outside the allowed range #62

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

Merged
merged 2 commits into from
Jun 25, 2024
Merged

Conversation

jedel1043
Copy link
Member

Maybe we could move the check to IsoDate's constructor? For now this is enough to pass test262.

@jedel1043 jedel1043 added C-bug Something isn't working C-internal Internal library improvements labels Jun 25, 2024
Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

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

I'd be fine with merging this as is, but I think I'd prefer this go on the constructor for IsoDate after taking a look at it.

The date from IsoDate::new_unchecked needs to be validated to be within limits on the constrain and reject options. Plus, that then allows implementing the check with iso_dt_within_valid_limits

@jedel1043
Copy link
Member Author

Yep, I'd also advocate for that, but we can do that on some future cleanups when we're certain that the spec won't suddenly change

@nekevss
Copy link
Member

nekevss commented Jun 25, 2024

Im not convinced that part of the spec will change. At least on the date and datetime constructor. Those are pretty stable.

@jedel1043
Copy link
Member Author

Hmm, in that case I'll just move this to the constructor.

@jedel1043 jedel1043 force-pushed the deny-iso-date-range branch from 07771a3 to f10919f Compare June 25, 2024 05:51
@jedel1043 jedel1043 requested a review from nekevss June 25, 2024 05:53
Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

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

LGTM :)

@jedel1043 jedel1043 merged commit 2b4cbb2 into main Jun 25, 2024
5 checks passed
@jedel1043 jedel1043 deleted the deny-iso-date-range branch June 25, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Something isn't working C-internal Internal library improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants