Skip to content

Editorial: Correct return value of ComputeNudgeWindow - #3298

Merged
ptomato merged 1 commit into
tc39:mainfrom
catamorphism:compute-nudge-window
Mar 31, 2026
Merged

Editorial: Correct return value of ComputeNudgeWindow#3298
ptomato merged 1 commit into
tc39:mainfrom
catamorphism:compute-nudge-window

Conversation

@catamorphism

Copy link
Copy Markdown
Contributor

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.)

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

codecov Bot commented Mar 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.83%. Comparing base (d27503d) to head (c7284b6).
⚠️ Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ptomato ptomato left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

I will port this over to the Stage 4 PR text.

@ptomato
ptomato merged commit e2da8c7 into tc39:main Mar 31, 2026
10 checks passed
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
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.

2 participants