File tree 2 files changed +12
-13
lines changed
2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -525,6 +525,9 @@ added:
525
525
* ` delay ` {number} The number of milliseconds to wait before resolving the
526
526
promise.
527
527
* ` 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 ` .
528
531
* ` signal ` {AbortSignal} An optional ` AbortSignal ` that can be used to
529
532
cancel waiting.
530
533
* Returns: {Promise}
Original file line number Diff line number Diff line change @@ -131,22 +131,18 @@ function setImmediate(value, options = kEmptyObject) {
131
131
}
132
132
133
133
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
+ }
138
137
139
- validateObject ( options , 'options' ) ;
138
+ validateObject ( options , 'options' ) ;
140
139
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
+ }
144
143
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' ) ;
150
146
}
151
147
152
148
const { signal, ref = true } = options ;
You can’t perform that action at this time.
0 commit comments