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: document ref option for scheduler.wait · nodejs/node@b6ed97c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • timers.md
  • lib/timers
    • promises.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/timers.md‎

Copy file name to clipboardExpand all lines: doc/api/timers.md
+3Lines changed: 3 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,9 @@ added:
521521
* `delay` {number} The number of milliseconds to wait before resolving the
522522
promise.
523523
* `options` {Object}
524+
* `ref` {boolean} Set to `false` to indicate that the scheduled `Timeout`
525+
should not require the Node.js event loop to remain active.
526+
**Default:** `true`.
524527
* `signal` {AbortSignal} An optional `AbortSignal` that can be used to
525528
cancel waiting.
526529
* Returns: {Promise}
Collapse file

‎lib/timers/promises.js‎

Copy file name to clipboardExpand all lines: lib/timers/promises.js
+9-13Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -131,22 +131,18 @@ function setImmediate(value, options = kEmptyObject) {
131131
}
132132

133133
async function* setInterval(after, value, options = kEmptyObject) {
134-
try {
135-
if (typeof after !== 'undefined') {
136-
validateNumber(after, 'delay');
137-
}
134+
if (typeof after !== 'undefined') {
135+
validateNumber(after, 'delay');
136+
}
138137

139-
validateObject(options, 'options');
138+
validateObject(options, 'options');
140139

141-
if (typeof options?.signal !== 'undefined') {
142-
validateAbortSignal(options.signal, 'options.signal');
143-
}
140+
if (typeof options?.signal !== 'undefined') {
141+
validateAbortSignal(options.signal, 'options.signal');
142+
}
144143

145-
if (typeof options?.ref !== 'undefined') {
146-
validateBoolean(options.ref, 'options.ref');
147-
}
148-
} catch (err) {
149-
return PromiseReject(err);
144+
if (typeof options?.ref !== 'undefined') {
145+
validateBoolean(options.ref, 'options.ref');
150146
}
151147

152148
const { signal, ref = true } = options;

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.