@@ -150,26 +150,30 @@ export class DynamicChangeDetector extends AbstractChangeDetector<any> {
150150 return null ;
151151 }
152152
153- var prevValue = this . _readSelf ( proto ) ;
154153 var currValue = this . _calculateCurrValue ( proto ) ;
155-
156- if ( ! isSame ( prevValue , currValue ) ) {
157- if ( proto . lastInBinding ) {
158- var change = ChangeDetectionUtil . simpleChange ( prevValue , currValue ) ;
159- if ( throwOnChange ) ChangeDetectionUtil . throwOnChange ( proto , change ) ;
160-
161- this . _writeSelf ( proto , currValue ) ;
162- this . _setChanged ( proto , true ) ;
163-
164- return change ;
165-
154+ if ( proto . shouldBeChecked ( ) ) {
155+ var prevValue = this . _readSelf ( proto ) ;
156+ if ( ! isSame ( prevValue , currValue ) ) {
157+ if ( proto . lastInBinding ) {
158+ var change = ChangeDetectionUtil . simpleChange ( prevValue , currValue ) ;
159+ if ( throwOnChange ) ChangeDetectionUtil . throwOnChange ( proto , change ) ;
160+
161+ this . _writeSelf ( proto , currValue ) ;
162+ this . _setChanged ( proto , true ) ;
163+ return change ;
164+ } else {
165+ this . _writeSelf ( proto , currValue ) ;
166+ this . _setChanged ( proto , true ) ;
167+ return null ;
168+ }
166169 } else {
167- this . _writeSelf ( proto , currValue ) ;
168- this . _setChanged ( proto , true ) ;
170+ this . _setChanged ( proto , false ) ;
169171 return null ;
170172 }
173+
171174 } else {
172- this . _setChanged ( proto , false ) ;
175+ this . _writeSelf ( proto , currValue ) ;
176+ this . _setChanged ( proto , true ) ;
173177 return null ;
174178 }
175179 }
@@ -215,6 +219,7 @@ export class DynamicChangeDetector extends AbstractChangeDetector<any> {
215219
216220 case RecordType . INTERPOLATE :
217221 case RecordType . PRIMITIVE_OP :
222+ case RecordType . COLLECTION_LITERAL :
218223 return FunctionWrapper . apply ( proto . funcOrValue , this . _readArgs ( proto ) ) ;
219224
220225 default :
@@ -227,28 +232,34 @@ export class DynamicChangeDetector extends AbstractChangeDetector<any> {
227232 var args = this . _readArgs ( proto ) ;
228233
229234 var pipe = this . _pipeFor ( proto , context ) ;
230- var prevValue = this . _readSelf ( proto ) ;
231235 var currValue = pipe . transform ( context , args ) ;
232236
233- if ( ! isSame ( prevValue , currValue ) ) {
234- currValue = ChangeDetectionUtil . unwrapValue ( currValue ) ;
237+ if ( proto . shouldBeChecked ( ) ) {
238+ var prevValue = this . _readSelf ( proto ) ;
239+ if ( ! isSame ( prevValue , currValue ) ) {
240+ currValue = ChangeDetectionUtil . unwrapValue ( currValue ) ;
235241
236- if ( proto . lastInBinding ) {
237- var change = ChangeDetectionUtil . simpleChange ( prevValue , currValue ) ;
238- if ( throwOnChange ) ChangeDetectionUtil . throwOnChange ( proto , change ) ;
242+ if ( proto . lastInBinding ) {
243+ var change = ChangeDetectionUtil . simpleChange ( prevValue , currValue ) ;
244+ if ( throwOnChange ) ChangeDetectionUtil . throwOnChange ( proto , change ) ;
239245
240- this . _writeSelf ( proto , currValue ) ;
241- this . _setChanged ( proto , true ) ;
246+ this . _writeSelf ( proto , currValue ) ;
247+ this . _setChanged ( proto , true ) ;
242248
243- return change ;
249+ return change ;
244250
251+ } else {
252+ this . _writeSelf ( proto , currValue ) ;
253+ this . _setChanged ( proto , true ) ;
254+ return null ;
255+ }
245256 } else {
246- this . _writeSelf ( proto , currValue ) ;
247- this . _setChanged ( proto , true ) ;
257+ this . _setChanged ( proto , false ) ;
248258 return null ;
249259 }
250260 } else {
251- this . _setChanged ( proto , false ) ;
261+ this . _writeSelf ( proto , currValue ) ;
262+ this . _setChanged ( proto , true ) ;
252263 return null ;
253264 }
254265 }
@@ -284,7 +295,9 @@ export class DynamicChangeDetector extends AbstractChangeDetector<any> {
284295
285296 _writePipe ( proto : ProtoRecord , value ) { this . localPipes [ proto . selfIndex ] = value ; }
286297
287- _setChanged ( proto : ProtoRecord , value : boolean ) { this . changes [ proto . selfIndex ] = value ; }
298+ _setChanged ( proto : ProtoRecord , value : boolean ) {
299+ if ( proto . argumentToPureFunction ) this . changes [ proto . selfIndex ] = value ;
300+ }
288301
289302 _pureFuncAndArgsDidNotChange ( proto : ProtoRecord ) : boolean {
290303 return proto . isPureFunction ( ) && ! this . _argsChanged ( proto ) ;
0 commit comments