Skip to content

Fix bug introduced by EpochNanoseconds + adjust tests to catch better#128

Merged
nekevss merged 2 commits into
mainfrom
fix-limit-tests
Dec 8, 2024
Merged

Fix bug introduced by EpochNanoseconds + adjust tests to catch better#128
nekevss merged 2 commits into
mainfrom
fix-limit-tests

Conversation

@nekevss

@nekevss nekevss commented Dec 8, 2024

Copy link
Copy Markdown
Member

This fixes a bug that was introduced by #116.

General gist is that the in the proposal 5.5.4 ISODateTimeWithinLimits ( isoDateTime ) there is a call to GetUTCEpochNanoseconds. However, this value is not checked to be valid, and instead of constraining to the NS_MAX_INSTANT/NS_MIN_INSTANT +/- NS_PER_DAY, respectively, we were constraining to NS_MAX_INSTANT/NS_MIN_INSTANT.

There was a limit test on datetime, but we were only asserting the negative case, not the positive case, so the regression was not caught.

So adjusted to handle the potentially invalid value, adjusted the preexisting datetime test, and added a date limit test based off the test262 limit test.

EDIT: Potentially relevant context to #119

@nekevss nekevss added the C-bug Something isn't working label Dec 8, 2024
@nekevss nekevss merged commit 016bc31 into main Dec 8, 2024
@nekevss nekevss deleted the fix-limit-tests branch December 9, 2024 02:35
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants