@@ -622,10 +622,18 @@ class DirtyCheckingRecord<H> implements WatchRecord<H> {
622
622
}
623
623
624
624
var last = currentValue;
625
- if (! _looseIdentical (last, current)) {
626
- previousValue = currentValue;
627
- currentValue = current;
628
- return true ;
625
+ if (! identical (last, current)) {
626
+ if (last is String && current is String && last == current) {
627
+ // This is false change in strings we need to recover, and pretend it
628
+ // is the same. We save the value so that next time identity will pass
629
+ currentValue = current;
630
+ } else if (last is num && last.isNaN && current is num && current.isNaN) {
631
+ // we need this for the compiled JavaScript since in JS NaN !== NaN.
632
+ } else {
633
+ previousValue = last;
634
+ currentValue = current;
635
+ return true ;
636
+ }
629
637
}
630
638
return false ;
631
639
}
@@ -1538,12 +1546,8 @@ class DuplicateMap {
1538
1546
bool _looseIdentical (dst, src) {
1539
1547
if (identical (dst, src)) return true ;
1540
1548
1541
- if (dst is String && src is String && dst == src) {
1542
- // this is false change in strings we need to recover, and pretend it is the same. We save the
1543
- // value so that next time identity can pass
1544
- dst = src;
1545
- return true ;
1546
- }
1549
+ // Dart could have string1 == string2 without identical(string1, string2)
1550
+ if (dst is String && src is String && dst == src) return true ;
1547
1551
1548
1552
// we need this for JavaScript since in JS NaN !== NaN.
1549
1553
if (dst is num && (dst as num ).isNaN && src is num && (src as num ).isNaN) return true ;
0 commit comments