OLD | NEW |
1 library node; | 1 library node; |
2 | 2 |
3 class Node { | 3 class Node { |
4 | 4 |
5 // Nodes always have a 'depth' greater than their ancestors'. | 5 // Nodes always have a 'depth' greater than their ancestors'. |
6 // There's no guarantee regarding depth between siblings. The depth | 6 // There's no guarantee regarding depth between siblings. The depth |
7 // of a node is used to ensure that nodes are processed in depth | 7 // of a node is used to ensure that nodes are processed in depth |
8 // order. The 'depth' of a child can be more than one greater than | 8 // order. The 'depth' of a child can be more than one greater than |
9 // the 'depth' of the parent, because the 'depth' values are never | 9 // the 'depth' of the parent, because the 'depth' values are never |
10 // decreased: all that matters is that it's greater than the parent. | 10 // decreased: all that matters is that it's greater than the parent. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 redepthChild(child); | 51 redepthChild(child); |
52 } | 52 } |
53 void dropChild(Node child) { // only for use by subclasses | 53 void dropChild(Node child) { // only for use by subclasses |
54 assert(child != null); | 54 assert(child != null); |
55 assert(child.attached == attached); | 55 assert(child.attached == attached); |
56 if (attached) | 56 if (attached) |
57 child.detach(); | 57 child.detach(); |
58 } | 58 } |
59 | 59 |
60 } | 60 } |
OLD | NEW |