File tree 1 file changed +7
-17
lines changed
1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -581,30 +581,20 @@ function getComputedOrder(inst) {
581
581
function dependencyCounts ( inst ) {
582
582
const infoForComputed = inst [ COMPUTE_INFO ] ;
583
583
const counts = { } ;
584
+ const computedDeps = inst [ TYPES . COMPUTE ] ;
584
585
const ready = [ ] ;
585
586
let total = 0 ;
587
+ // Count dependencies for each computed property
586
588
for ( let p in infoForComputed ) {
587
589
const info = infoForComputed [ p ] ;
588
590
// Be sure to add the method name itself in case of "dynamic functions"
589
591
total += counts [ p ] =
590
592
info . args . filter ( a => ! a . literal ) . length + ( info . dynamicFn ? 1 : 0 ) ;
591
- // Add any dependencies that are not themselves computed to the ready queue
592
- info . args . forEach ( arg => {
593
- const dep = arg . rootProperty ;
594
- // Putting a count of 0 in for ready deps is used for de-duping
595
- if ( dep && ! infoForComputed [ dep ] && ! ( dep in counts ) ) {
596
- counts [ dep ] = 0 ;
597
- ready . push ( dep ) ;
598
- }
599
- } ) ;
600
- // Add the method name to the ready queue if "dynamic function"
601
- if ( info . dynamicFn ) {
602
- const dep = info . methodName ;
603
- // Putting a count of 0 in for ready deps is used for de-duping
604
- if ( dep && ! infoForComputed [ dep ] && ! ( dep in counts ) ) {
605
- counts [ dep ] = 0 ;
606
- ready . push ( dep ) ;
607
- }
593
+ }
594
+ // Build list of ready properties (that aren't themselves computed)
595
+ for ( let p in computedDeps ) {
596
+ if ( ! infoForComputed [ p ] ) {
597
+ ready . push ( p ) ;
608
598
}
609
599
}
610
600
return { counts, ready, total} ;
You can’t perform that action at this time.
0 commit comments