@@ -110,10 +110,12 @@ class FilesWatcher extends EventEmitter {
110110 return [ ...this . #watchers. keys ( ) ] ;
111111 }
112112
113- watchPath ( path , recursive = true , allowMissing = false ) {
113+ watchPath ( path , recursive = true , options = kEmptyObject ) {
114114 if ( this . #isPathWatched( path ) ) {
115115 return ;
116116 }
117+ const { allowMissing = false } = options ;
118+
117119 const watcher = watch ( path , { recursive, signal : this . #signal, throwIfNoEntry : ! allowMissing } ) ;
118120 watcher . on ( 'change' , ( eventType , fileName ) => {
119121 // `fileName` can be `null` if it cannot be determined. See
@@ -126,14 +128,14 @@ class FilesWatcher extends EventEmitter {
126128 }
127129 }
128130
129- filterFile ( file , owner , allowMissing = false ) {
131+ filterFile ( file , owner , options = kEmptyObject ) {
130132 if ( ! file ) return ;
131133 if ( supportsRecursiveWatching ) {
132- this . watchPath ( dirname ( file ) , true , allowMissing ) ;
134+ this . watchPath ( dirname ( file ) , true , options ) ;
133135 } else {
134136 // Having multiple FSWatcher's seems to be slower
135137 // than a single recursive FSWatcher
136- this . watchPath ( file , false , allowMissing ) ;
138+ this . watchPath ( file , false , options ) ;
137139 }
138140 this . #filteredFiles. add ( file ) ;
139141 if ( owner ) {
0 commit comments