File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,12 +158,14 @@ function createFileScanCacheStore({
158158
159159 /**
160160 * Serializes write operations to prevent corruption.
161+ * Previous errors in the chain are swallowed so the next operation can proceed.
161162 * @param {function(): Promise<void> } fn
162163 * @returns {Promise<void> }
163164 */
164165 function enqueueWrite ( fn ) {
165- writeChain = writeChain . then ( fn , fn ) ;
166- return writeChain ;
166+ const next = writeChain . then ( fn , ( ) => fn ( ) ) ;
167+ writeChain = next . catch ( ( ) => undefined ) ;
168+ return next ;
167169 }
168170
169171 return {
Original file line number Diff line number Diff line change @@ -140,10 +140,12 @@ function createGraphUpdater({
140140 }
141141 }
142142 // Add new keywords
143- for ( const kw of newKeywords ) {
143+ if ( newKeywords . length > 0 ) {
144144 keywordsChanged = true ;
145- if ( ! keywordMap . has ( kw . keyword ) ) keywordMap . set ( kw . keyword , [ ] ) ;
146- keywordMap . get ( kw . keyword ) . push ( kw ) ;
145+ for ( const kw of newKeywords ) {
146+ if ( ! keywordMap . has ( kw . keyword ) ) keywordMap . set ( kw . keyword , [ ] ) ;
147+ keywordMap . get ( kw . keyword ) . push ( kw ) ;
148+ }
147149 }
148150
149151 // --- Update includes ---
Original file line number Diff line number Diff line change @@ -363,7 +363,8 @@ const SMALL_FILE_THRESHOLD = 1024 * 1024; // 1 MB
363363 */
364364function collectIncludeDirectivesFromBuffer ( buffer , basePath ) {
365365 // Quick scan: if the buffer doesn't contain '*INCLUDE' at all, skip parsing entirely
366- if ( buffer . indexOf ( '*INCLUDE' ) === - 1 ) {
366+ const INCLUDE_MARKER = Buffer . from ( '*INCLUDE' ) ;
367+ if ( buffer . indexOf ( INCLUDE_MARKER ) === - 1 ) {
367368 return { includeEntries : [ ] , searchPaths : [ basePath ] } ;
368369 }
369370
You can’t perform that action at this time.
0 commit comments