Skip to content

Conversation

gurgunday
Copy link
Member

// Fewer checks may be possible, but these cover everything.

emitDestroy already checks these now:

function emitDestroyScript(asyncId) {
// Return early if there are no destroy callbacks, or invalid asyncId.
if (!hasHooks(kDestroy) || asyncId <= 0)
return;
async_wrap.queueDestroyAsyncId(asyncId);
}

We are essentially checking the same condition twice

Also the invalid id check didn't cover undefined. I don't know if it was intentional, but in any case, since #56966, which removed enroll, I'm not sure if we can have an undefined asyncId anyway

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

codecov bot commented Oct 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.48%. Comparing base (6f941fc) to head (0255b2e).
⚠️ Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60120      +/-   ##
==========================================
+ Coverage   88.45%   88.48%   +0.02%     
==========================================
  Files         703      703              
  Lines      207826   207822       -4     
  Branches    40030    40027       -3     
==========================================
+ Hits       183842   183889      +47     
+ Misses      15973    15940      -33     
+ Partials     8011     7993      -18     
Files with missing lines Coverage Δ
lib/internal/async_hooks.js 99.37% <100.00%> (ø)
lib/internal/process/task_queues.js 100.00% <100.00%> (ø)
lib/internal/timers.js 99.72% <100.00%> (+0.13%) ⬆️
lib/timers.js 100.00% <100.00%> (ø)

... and 55 files with indirect coverage changes

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
async_hooks Issues and PRs related to the async hooks subsystem. needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. 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.

3 participants