@@ -35,6 +35,10 @@ const {
35
35
validateObject,
36
36
} = require ( 'internal/validators' ) ;
37
37
38
+ const {
39
+ kEmptyObject,
40
+ } = require ( 'internal/util' ) ;
41
+
38
42
const kScheduler = Symbol ( 'kScheduler' ) ;
39
43
40
44
function cancelListenerHandler ( clear , reject , signal ) {
@@ -44,7 +48,7 @@ function cancelListenerHandler(clear, reject, signal) {
44
48
}
45
49
}
46
50
47
- function setTimeout ( after , value , options = { } ) {
51
+ function setTimeout ( after , value , options = kEmptyObject ) {
48
52
const args = value !== undefined ? [ value ] : value ;
49
53
if ( options == null || typeof options !== 'object' ) {
50
54
return PromiseReject (
@@ -88,7 +92,7 @@ function setTimeout(after, value, options = {}) {
88
92
( ) => signal . removeEventListener ( 'abort' , oncancel ) ) : ret ;
89
93
}
90
94
91
- function setImmediate ( value , options = { } ) {
95
+ function setImmediate ( value , options = kEmptyObject ) {
92
96
if ( options == null || typeof options !== 'object' ) {
93
97
return PromiseReject (
94
98
new ERR_INVALID_ARG_TYPE (
@@ -132,7 +136,7 @@ function setImmediate(value, options = {}) {
132
136
( ) => signal . removeEventListener ( 'abort' , oncancel ) ) : ret ;
133
137
}
134
138
135
- async function * setInterval ( after , value , options = { } ) {
139
+ async function * setInterval ( after , value , options = kEmptyObject ) {
136
140
validateObject ( options , 'options' ) ;
137
141
const { signal, ref = true } = options ;
138
142
validateAbortSignal ( signal , 'options.signal' ) ;
0 commit comments