Merge pull request #1083 from Hixie/card-bug

Avoid infinite loop in syncChildren().
This commit is contained in:
Ian Hickson
2015-09-08 14:03:51 -07:00

View File

@@ -563,8 +563,7 @@ abstract class TagNode extends Widget {
void _sync(Widget old, dynamic slot) { void _sync(Widget old, dynamic slot) {
assert(!_debugChildTaken); assert(!_debugChildTaken);
Widget oldChild = (old as TagNode)?.child; child = syncChild(child, (old as TagNode)?.child, slot);
child = syncChild(child, oldChild, slot);
if (child != null) { if (child != null) {
assert(child.parent == this); assert(child.parent == this);
assert(child.renderObject != null); assert(child.renderObject != null);
@@ -945,6 +944,12 @@ abstract class StatefulComponent extends Component {
fn(); fn();
_scheduleBuild(); _scheduleBuild();
} }
String toStringName([String prefix = '', String startPrefix = '']) {
if (_disqualifiedFromEverAppearingAgain)
return '[[DISQUALIFIED]] ${super.toStringName()}';
return super.toStringName();
}
} }
Set<Component> _dirtyComponents = new Set<Component>(); Set<Component> _dirtyComponents = new Set<Component>();
@@ -1228,8 +1233,8 @@ abstract class RenderObjectWrapper extends Widget {
} else { } else {
syncChild(null, oldChild, null); syncChild(null, oldChild, null);
} }
oldChildrenBottom -= 1; } // else the node was probably moved elsewhere, ignore it
} oldChildrenBottom -= 1;
} }
} }