File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1415,7 +1415,7 @@ namespace ts {
14151415 }
14161416
14171417 /** Remove the *first* element satisfying `predicate`. */
1418- export function unorderedRemoveFirstItemWhere < T > ( array : T [ ] , predicate : ( element : T ) => boolean ) : void {
1418+ function unorderedRemoveFirstItemWhere < T > ( array : T [ ] , predicate : ( element : T ) => boolean ) : void {
14191419 for ( let i = 0 ; i < array . length ; i ++ ) {
14201420 if ( predicate ( array [ i ] ) ) {
14211421 unorderedRemoveItemAt ( array , i ) ;
Original file line number Diff line number Diff line change @@ -209,12 +209,13 @@ namespace ts {
209209 watchDirectory ( directoryName : string , callback : DirectoryWatcherCallback , recursive : boolean ) : DirectoryWatcher {
210210 const path = this . toPath ( directoryName ) ;
211211 const callbacks = lookUp ( this . watchedDirectories , path ) || ( this . watchedDirectories [ path ] = [ ] ) ;
212- callbacks . push ( { cb : callback , recursive } ) ;
212+ const cbWithRecursive = { cb : callback , recursive } ;
213+ callbacks . push ( cbWithRecursive ) ;
213214 return {
214215 referenceCount : 0 ,
215216 directoryName,
216217 close : ( ) => {
217- unorderedRemoveFirstItemWhere ( callbacks , cb => cb . cb === callback ) ;
218+ unorderedRemoveItem ( cbWithRecursive , callbacks ) ;
218219 if ( ! callbacks . length ) {
219220 delete this . watchedDirectories [ path ] ;
220221 }
You can’t perform that action at this time.
0 commit comments