angular/angular.js — pull request #5182 by dtabuenc (2013-11-28 06:05:29+00:00)
Title: fix($compile): ensure isolated local watches' lastValue is always in syn...

...c

When using two-way binding with isolate scope, under some circumstances
the lastValue variable captured in the parentValueWatch function can get
out of sync.

Specifically, if both the value in the origin scope as well as the value
in the isolate scope get independently updated to the same value within
one digest cycle, the lastValue is never updated. This potentially causes
the watch to make the wrong decision as to which side to update on subsequent
passes.

This fixes things by ensuring lastValue is always set to the last seen
value even if the watch's logic was shrot circuited because there was no
difference between the values in the original and isolate scopes.