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

timers: (clearImmediate) only accept immediate #57069

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gurgunday
Copy link
Contributor

Fixes #57063

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. labels Feb 15, 2025
Copy link

codecov bot commented Feb 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.08%. Comparing base (1d8593e) to head (69cec8a).
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57069      +/-   ##
==========================================
- Coverage   89.09%   89.08%   -0.01%     
==========================================
  Files         665      665              
  Lines      193249   193249              
  Branches    37231    37232       +1     
==========================================
- Hits       172175   172159      -16     
- Misses      13802    13822      +20     
+ Partials     7272     7268       -4     
Files with missing lines Coverage Δ
lib/timers.js 100.00% <100.00%> (ø)

... and 33 files with indirect coverage changes

@gurgunday
Copy link
Contributor Author

Rebased

@jasnell jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 18, 2025
@@ -301,7 +301,7 @@ ObjectDefineProperty(setImmediate, customPromisify, {
* @returns {void}
*/
function clearImmediate(immediate) {
if (!immediate || immediate._destroyed)
if (!immediate?._onImmediate || immediate._destroyed)
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately, even tho we're not adding a throw, I think this is going to need to be semver-major

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No strong opinions, but isn't it a bug fix? Bug fixes are "breaking" by nature

Copy link
Member

Choose a reason for hiding this comment

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

I think opinions on this can vary. Unfortunately since it has worked this way for such a long time we have to treat it as a semver-major

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I see, just wanted to double check, thanks for the response!

Copy link
Member

Choose a reason for hiding this comment

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

I am +1 on this being semver-major

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling clearImmediate on setTimeout return value can make future setTimeout callbacks never run
6 participants