@@ -333,38 +333,39 @@ export class DynamicChangeDetector extends AbstractChangeDetector<any> {
333333
334334  _pipeCheck ( proto : ProtoRecord ,  throwOnChange : boolean ,  values : any [ ] )  { 
335335    var  context  =  this . _readContext ( proto ,  values ) ; 
336-     var  args  =  this . _readArgs ( proto ,  values ) ; 
336+     var  selectedPipe  =  this . _pipeFor ( proto ,  context ) ; 
337+     if  ( ! selectedPipe . pure  ||  this . _argsOrContextChanged ( proto ) )  { 
338+       var  args  =  this . _readArgs ( proto ,  values ) ; 
339+       var  currValue  =  selectedPipe . pipe . transform ( context ,  args ) ; 
337340
338-     var  pipe  =  this . _pipeFor ( proto ,  context ) ; 
339-     var  currValue  =  pipe . transform ( context ,  args ) ; 
341+       if  ( proto . shouldBeChecked ( ) )  { 
342+         var  prevValue  =  this . _readSelf ( proto ,  values ) ; 
343+         if  ( ! isSame ( prevValue ,  currValue ) )  { 
344+           currValue  =  ChangeDetectionUtil . unwrapValue ( currValue ) ; 
340345
341-     if  ( proto . shouldBeChecked ( ) )  { 
342-       var  prevValue  =  this . _readSelf ( proto ,  values ) ; 
343-       if  ( ! isSame ( prevValue ,  currValue ) )  { 
344-         currValue  =  ChangeDetectionUtil . unwrapValue ( currValue ) ; 
345- 
346-         if  ( proto . lastInBinding )  { 
347-           var  change  =  ChangeDetectionUtil . simpleChange ( prevValue ,  currValue ) ; 
348-           if  ( throwOnChange )  this . throwOnChangeError ( prevValue ,  currValue ) ; 
346+           if  ( proto . lastInBinding )  { 
347+             var  change  =  ChangeDetectionUtil . simpleChange ( prevValue ,  currValue ) ; 
348+             if  ( throwOnChange )  this . throwOnChangeError ( prevValue ,  currValue ) ; 
349349
350-           this . _writeSelf ( proto ,  currValue ,  values ) ; 
351-           this . _setChanged ( proto ,  true ) ; 
350+              this . _writeSelf ( proto ,  currValue ,  values ) ; 
351+              this . _setChanged ( proto ,  true ) ; 
352352
353-           return  change ; 
353+              return  change ; 
354354
355+           }  else  { 
356+             this . _writeSelf ( proto ,  currValue ,  values ) ; 
357+             this . _setChanged ( proto ,  true ) ; 
358+             return  null ; 
359+           } 
355360        }  else  { 
356-           this . _writeSelf ( proto ,  currValue ,  values ) ; 
357-           this . _setChanged ( proto ,  true ) ; 
361+           this . _setChanged ( proto ,  false ) ; 
358362          return  null ; 
359363        } 
360364      }  else  { 
361-         this . _setChanged ( proto ,  false ) ; 
365+         this . _writeSelf ( proto ,  currValue ,  values ) ; 
366+         this . _setChanged ( proto ,  true ) ; 
362367        return  null ; 
363368      } 
364-     }  else  { 
365-       this . _writeSelf ( proto ,  currValue ,  values ) ; 
366-       this . _setChanged ( proto ,  true ) ; 
367-       return  null ; 
368369    } 
369370  } 
370371
@@ -413,6 +414,10 @@ export class DynamicChangeDetector extends AbstractChangeDetector<any> {
413414    return  false ; 
414415  } 
415416
417+   _argsOrContextChanged ( proto : ProtoRecord ) : boolean  { 
418+     return  this . _argsChanged ( proto )  ||  this . changes [ proto . contextIndex ] ; 
419+   } 
420+ 
416421  _readArgs ( proto : ProtoRecord ,  values : any [ ] )  { 
417422    var  res  =  ListWrapper . createFixedSize ( proto . args . length ) ; 
418423    var  args  =  proto . args ; 
0 commit comments