Editorial: Correct return value of ComputeNudgeWindow - #3298
Merged
Conversation
ComputeNudgeWindow was declared to return a record whose [[StartDuration]] and [[EndDuration]] fields are Internal Duration Records, but step 13 set [[StartDuration]] to _startDuration_ and [[EndDuration]] to _endDuration_; both _startDuration_ and _endDuration_ were actually Date Duration Records. Fixed this by renaming the variables to _startDateDuration_ and _endDateDuration_ and converting to Internal Duration Records at the end. Also, removed step 24 from NudgeToCalendarUnit because it's unnecessary (_resultDuration_ is already an Internal Duration Record.)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3298 +/- ##
=======================================
Coverage 97.83% 97.83%
=======================================
Files 22 22
Lines 10725 10725
Branches 1856 1856
=======================================
Hits 10493 10493
Misses 215 215
Partials 17 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ptomato
approved these changes
Mar 31, 2026
ptomato
left a comment
Member
There was a problem hiding this comment.
Thanks!
I will port this over to the Stage 4 PR text.
ptomato
added a commit
to ptomato/ecma262
that referenced
this pull request
Mar 31, 2026
These variables had the wrong types, and needed to be converted from Date Duration Record to Internal Duration Record to make the types match up. No practical change needed for implementations. h/t Tim Chevalier
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ComputeNudgeWindow was declared to return a record whose [[StartDuration]] and [[EndDuration]] fields are Internal Duration Records, but step 13 set [[StartDuration]] to startDuration and [[EndDuration]] to endDuration; both startDuration and endDuration were actually Date Duration Records.
Fixed this by renaming the variables to startDateDuration and endDateDuration and converting to Internal Duration Records at the end. Also, removed step 24 from NudgeToCalendarUnit because it's unnecessary (resultDuration is already an Internal Duration Record.)