@ -68,11 +68,12 @@ function effect_label(effect, append_effect = false) {
return label ;
return label ;
}
}
/ * *
/ * *
*
* @ param { Effect } effect
* @ param { Effect } effect
* @ param { Effect [ ] } highlighted
* /
* /
export function log _effect _tree ( effect , depth = 0 , is _reachable = true ) {
export function log _effect _tree ( effect , highlighted = [ ] , depth = 0 , is _reachable = true ) {
const flags = effect . f ;
const flags = effect . f ;
let label = effect _label ( effect ) ;
let label = effect _label ( effect ) ;
@ -86,6 +87,14 @@ export function log_effect_tree(effect, depth = 0, is_reachable = true) {
styles . push ( ` color: red ` ) ;
styles . push ( ` color: red ` ) ;
}
}
if ( ( flags & INERT ) !== 0 ) {
styles . push ( 'font-style: italic' ) ;
}
if ( highlighted . includes ( effect ) ) {
styles . push ( 'background-color: yellow' ) ;
}
// eslint-disable-next-line no-console
// eslint-disable-next-line no-console
console . group ( ` %c ${ label } ( ${ status } ) ` , styles . join ( '; ' ) ) ;
console . group ( ` %c ${ label } ( ${ status } ) ` , styles . join ( '; ' ) ) ;
@ -131,7 +140,7 @@ export function log_effect_tree(effect, depth = 0, is_reachable = true) {
let child = effect . first ;
let child = effect . first ;
while ( child !== null ) {
while ( child !== null ) {
log _effect _tree ( child , depth + 1 , child _is _reachable ) ;
log _effect _tree ( child , highlighted, depth + 1 , child _is _reachable ) ;
child = child . next ;
child = child . next ;
}
}