This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -1944,6 +1944,7 @@ function $ParseProvider() {
1944
1944
return second ( first ( value ) ) ;
1945
1945
}
1946
1946
chainedInterceptor . $stateful = first . $stateful || second . $stateful ;
1947
+ chainedInterceptor . $pure = first . $pure && second . $pure ;
1947
1948
1948
1949
return chainedInterceptor ;
1949
1950
}
@@ -1979,14 +1980,18 @@ function $ParseProvider() {
1979
1980
// If the expression itself has no inputs then use the full expression as an input.
1980
1981
if ( ! interceptorFn . $stateful ) {
1981
1982
useInputs = ! parsedExpression . inputs ;
1982
- fn . inputs = ( parsedExpression . inputs ? parsedExpression . inputs : [ parsedExpression ] ) . map ( function ( e ) {
1983
+ fn . inputs = parsedExpression . inputs ? parsedExpression . inputs : [ parsedExpression ] ;
1984
+
1985
+ if ( ! interceptorFn . $pure ) {
1986
+ fn . inputs = fn . inputs . map ( function ( e ) {
1983
1987
// Remove the isPure flag of inputs when it is not absolute because they are now wrapped in a
1984
- // potentially non-pure interceptor function.
1988
+ // non-pure interceptor function.
1985
1989
if ( e . isPure === PURITY_RELATIVE ) {
1986
1990
return function depurifier ( s ) { return e ( s ) ; } ;
1987
1991
}
1988
1992
return e ;
1989
1993
} ) ;
1994
+ }
1990
1995
}
1991
1996
1992
1997
return addWatchDelegate ( fn ) ;
Original file line number Diff line number Diff line change @@ -581,10 +581,10 @@ function $RootScopeProvider() {
581
581
* de-registration function is executed, the internal watch operation is terminated.
582
582
*/
583
583
$watchCollection : function ( obj , listener ) {
584
- // Mark it as $stateful to avoid any input-watching and always invoke the interceptor
584
+ // Mark literals as $pure to watch literal inputs of any type.
585
+ // Mark non literals as $stateful to avoid input-watching and always invoke the interceptor
585
586
// since the inputs will most likely be non-simple (like collections!).
586
- // ... unless it is a literal and input-watching may be sufficient.
587
- $watchCollectionInterceptor . $stateful = ! $parse ( obj ) . literal ;
587
+ $watchCollectionInterceptor . $stateful = ! ( $watchCollectionInterceptor . $pure = $parse ( obj ) . literal ) ;
588
588
589
589
var self = this ;
590
590
// the current value, updated on each dirty-check run
You can’t perform that action at this time.
0 commit comments