@@ -705,7 +705,7 @@ function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {
705
705
findConstantAndWatchExpressions ( ast . property , $filter , astIsPure ) ;
706
706
}
707
707
ast . constant = ast . object . constant && ( ! ast . computed || ast . property . constant ) ;
708
- ast . toWatch = [ ast ] ;
708
+ ast . toWatch = ast . constant ? [ ] : [ ast ] ;
709
709
break ;
710
710
case AST . CallExpression :
711
711
isStatelessFilter = ast . filter ? isStateless ( $filter , ast . callee . name ) : false ;
@@ -714,9 +714,7 @@ function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {
714
714
forEach ( ast . arguments , function ( expr ) {
715
715
findConstantAndWatchExpressions ( expr , $filter , astIsPure ) ;
716
716
allConstants = allConstants && expr . constant ;
717
- if ( ! expr . constant ) {
718
- argsToWatch . push . apply ( argsToWatch , expr . toWatch ) ;
719
- }
717
+ argsToWatch . push . apply ( argsToWatch , expr . toWatch ) ;
720
718
} ) ;
721
719
ast . constant = allConstants ;
722
720
ast . toWatch = isStatelessFilter ? argsToWatch : [ ast ] ;
@@ -733,9 +731,7 @@ function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {
733
731
forEach ( ast . elements , function ( expr ) {
734
732
findConstantAndWatchExpressions ( expr , $filter , astIsPure ) ;
735
733
allConstants = allConstants && expr . constant ;
736
- if ( ! expr . constant ) {
737
- argsToWatch . push . apply ( argsToWatch , expr . toWatch ) ;
738
- }
734
+ argsToWatch . push . apply ( argsToWatch , expr . toWatch ) ;
739
735
} ) ;
740
736
ast . constant = allConstants ;
741
737
ast . toWatch = argsToWatch ;
@@ -746,17 +742,12 @@ function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {
746
742
forEach ( ast . properties , function ( property ) {
747
743
findConstantAndWatchExpressions ( property . value , $filter , astIsPure ) ;
748
744
allConstants = allConstants && property . value . constant ;
749
- if ( ! property . value . constant ) {
750
- argsToWatch . push . apply ( argsToWatch , property . value . toWatch ) ;
751
- }
745
+ argsToWatch . push . apply ( argsToWatch , property . value . toWatch ) ;
752
746
if ( property . computed ) {
753
747
findConstantAndWatchExpressions ( property . key , $filter , astIsPure ) ;
754
748
allConstants = allConstants && property . key . constant ;
755
- if ( ! property . key . constant ) {
756
- argsToWatch . push . apply ( argsToWatch , property . key . toWatch ) ;
757
- }
749
+ argsToWatch . push . apply ( argsToWatch , property . key . toWatch ) ;
758
750
}
759
-
760
751
} ) ;
761
752
ast . constant = allConstants ;
762
753
ast . toWatch = argsToWatch ;
0 commit comments