GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — timers: check for immediate instance in clearImmediate · nodejs/node@2cbf3c3

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • timers.js
  • test/parallel
    • test-timers-invalid-clear.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/timers.js‎

Copy file name to clipboardExpand all lines: lib/timers.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ ObjectDefineProperty(setImmediate, customPromisify, {
301301
* @returns {void}
302302
*/
303303
function clearImmediate(immediate) {
304-
if (!immediate || immediate._destroyed)
304+
if (!immediate?._onImmediate || immediate._destroyed)
305305
return;
306306

307307
immediateInfo[kCount]--;
Collapse file

‎test/parallel/test-timers-invalid-clear.js‎

Copy file name to clipboard
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
// clearImmediate should be a noop if anything other than an Immediate
6+
// is passed to it.
7+
8+
const t = setTimeout(common.mustCall());
9+
10+
clearImmediate(t);
11+
12+
setTimeout(common.mustCall());
13+
setTimeout(common.mustCall());

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.