@@ -390,13 +390,13 @@ const DependenciesToAExprs = {
390390 associate ( dep , aexpr ) {
391391 const location = aexpr . meta ( ) . get ( "location" ) ;
392392 if ( location && location . file ) {
393+ DebuggingCache . updateFiles ( [ location . file ] ) ;
393394 this . _AEsPerFile . getOrCreate ( location . file , ( ) => new Set ( ) ) . add ( aexpr ) ;
394395 }
395396 this . _depsToAExprs . associate ( dep , aexpr ) ;
396397 dep . updateTracking ( ) ;
397398
398399 // Track affected files
399- DebuggingCache . updateFiles ( [ location . file ] ) ;
400400 for ( const hook of HooksToDependencies . getHooksForDep ( dep ) ) {
401401 hook . getLocations ( ) . then ( locations => DebuggingCache . updateFiles ( locations . map ( loc => loc . file ) ) ) ;
402402 }
@@ -405,6 +405,7 @@ const DependenciesToAExprs = {
405405 disconnectAllForAExpr ( aexpr ) {
406406 const location = aexpr . meta ( ) . get ( "location" ) ;
407407 if ( location && location . file ) {
408+ for ( const dep of DependenciesToAExprs . getDepsForAExpr ( aexpr ) ) {
408409 DebuggingCache . updateFiles ( [ location . file ] ) ;
409410 if ( this . _AEsPerFile . has ( location . file ) ) {
410411 this . _AEsPerFile . get ( location . file ) . delete ( aexpr ) ;
@@ -415,7 +416,6 @@ const DependenciesToAExprs = {
415416 deps . forEach ( dep => dep . updateTracking ( ) ) ;
416417
417418 // Track affected files
418- for ( const dep of DependenciesToAExprs . getDepsForAExpr ( aexpr ) ) {
419419 for ( const hook of HooksToDependencies . getHooksForDep ( dep ) ) {
420420 hook . getLocations ( ) . then ( locations => DebuggingCache . updateFiles ( locations . map ( loc => loc . file ) ) ) ;
421421 }
@@ -461,7 +461,9 @@ const HooksToDependencies = {
461461 // Track affected files
462462 hook . getLocations ( ) . then ( locations => DebuggingCache . updateFiles ( locations . map ( loc => loc . file ) ) ) ;
463463 for ( const ae of DependenciesToAExprs . getAExprsForDep ( dep ) ) {
464- DebuggingCache . updateFiles ( [ ae . meta ( ) . get ( "location" ) . file ] ) ;
464+ if ( ae . meta ( ) . has ( "location" ) ) {
465+ DebuggingCache . updateFiles ( [ ae . meta ( ) . get ( "location" ) . file ] ) ;
466+ }
465467 }
466468 } ,
467469
@@ -470,8 +472,10 @@ const HooksToDependencies = {
470472
471473 // Track affected files
472474 hook . getLocations ( ) . then ( locations => DebuggingCache . updateFiles ( locations . map ( loc => loc . file ) ) ) ;
473- for ( const ae of DependenciesToAExprs . getAExprsForDep ( dep ) ) {
474- DebuggingCache . updateFiles ( [ ae . meta ( ) . get ( "location" ) . file ] ) ;
475+ for ( const ae of DependenciesToAExprs . getAExprsForDep ( dep ) ) {
476+ if ( ae . meta ( ) . has ( "location" ) ) {
477+ DebuggingCache . updateFiles ( [ ae . meta ( ) . get ( "location" ) . file ] ) ;
478+ }
475479 }
476480 } ,
477481
@@ -494,8 +498,10 @@ const HooksToDependencies = {
494498 for ( const hook of HooksToDependencies . getHooksForDep ( dep ) ) {
495499 hook . getLocations ( ) . then ( locations => DebuggingCache . updateFiles ( locations . map ( loc => loc . file ) ) ) ;
496500 }
497- for ( const ae of DependenciesToAExprs . getAExprsForDep ( dep ) ) {
498- DebuggingCache . updateFiles ( [ ae . meta ( ) . get ( "location" ) . file ] ) ;
501+ for ( const ae of DependenciesToAExprs . getAExprsForDep ( dep ) ) {
502+ if ( ae . meta ( ) . has ( "location" ) ) {
503+ DebuggingCache . updateFiles ( [ ae . meta ( ) . get ( "location" ) . file ] ) ;
504+ }
499505 }
500506 } ,
501507
@@ -577,7 +583,9 @@ class Hook {
577583 this . getLocations ( ) . then ( locations => DebuggingCache . updateFiles ( locations . map ( loc => loc . file ) ) ) ;
578584 for ( const dep of HooksToDependencies . getDepsForHook ( this ) ) {
579585 for ( const ae of DependenciesToAExprs . getAExprsForDep ( dep ) ) {
580- DebuggingCache . updateFiles ( [ ae . meta ( ) . get ( "location" ) . file ] ) ;
586+ if ( ae . meta ( ) . has ( "location" ) ) {
587+ DebuggingCache . updateFiles ( [ ae . meta ( ) . get ( "location" ) . file ] ) ;
588+ }
581589 }
582590 }
583591 }
0 commit comments