File tree Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -525,6 +525,9 @@ added:
525525* ` delay ` {number} The number of milliseconds to wait before resolving the
526526 promise.
527527* ` options ` {Object}
528+ * ` ref ` {boolean} Set to ` false ` to indicate that the scheduled ` Timeout `
529+ should not require the Node.js event loop to remain active.
530+ ** Default:** ` true ` .
528531 * ` signal ` {AbortSignal} An optional ` AbortSignal ` that can be used to
529532 cancel waiting.
530533* Returns: {Promise}
Original file line number Diff line number Diff line change @@ -131,22 +131,18 @@ function setImmediate(value, options = kEmptyObject) {
131131}
132132
133133async 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 ;
You can’t perform that action at this time.
0 commit comments