Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: sky/sdk/lib/framework/fn2.dart

Issue 1169593002: Fix bogus asserts in searchForOldNode (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 library fn; 5 library fn;
6 6
7 import 'app.dart'; 7 import 'app.dart';
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection'; 9 import 'dart:collection';
10 import 'dart:mirrors'; 10 import 'dart:mirrors';
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 if (currentNode.interchangeable) 566 if (currentNode.interchangeable)
567 return false; // never re-order these nodes 567 return false; // never re-order these nodes
568 568
569 ensureOldIdMap(); 569 ensureOldIdMap();
570 oldNode = oldNodeIdMap[currentNode._key]; 570 oldNode = oldNodeIdMap[currentNode._key];
571 if (oldNode == null) 571 if (oldNode == null)
572 return false; 572 return false;
573 573
574 oldNodeIdMap[currentNode._key] = null; // mark it reordered 574 oldNodeIdMap[currentNode._key] = null; // mark it reordered
575 assert(root is ContainerRenderObjectMixin); 575 assert(root is ContainerRenderObjectMixin);
576 assert(oldNode.root is ContainerRenderObjectMixin); 576 assert(old.root is ContainerRenderObjectMixin);
577 assert(oldNode.root != null);
577 578
578 old.root.remove(oldNode.root); 579 old.root.remove(oldNode.root);
579 root.add(oldNode.root, before: nextSibling); 580 root.add(oldNode.root, before: nextSibling);
580 581
581 return true; 582 return true;
582 } 583 }
583 584
584 // Scan forwards, this time we may re-order; 585 // Scan forwards, this time we may re-order;
585 nextSibling = root.firstChild; 586 nextSibling = root.firstChild;
586 while (startIndex < endIndex && oldStartIndex < oldEndIndex) { 587 while (startIndex < endIndex && oldStartIndex < oldEndIndex) {
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 assert(root.parent is RenderView); 985 assert(root.parent is RenderView);
985 } 986 }
986 } 987 }
987 988
988 class Text extends Component { 989 class Text extends Component {
989 Text(this.data) : super(key: '*text*'); 990 Text(this.data) : super(key: '*text*');
990 final String data; 991 final String data;
991 bool get interchangeable => true; 992 bool get interchangeable => true;
992 UINode build() => new Paragraph(text: data); 993 UINode build() => new Paragraph(text: data);
993 } 994 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698