Skip to content

Commit

Permalink
added a comment and assert
Browse files Browse the repository at this point in the history
  • Loading branch information
damien-git committed Apr 12, 2017
1 parent 1fdf825 commit 601e3e5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/src/daxe_node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ abstract class DaxeNode {

/**
* Inserts [newdn] as a child of this node before [beforedn].
* beforedn may be null, in which case it is inserted as the last child.
* [beforedn] may be null, in which case it is inserted as the last child.
*/
void insertBefore(DaxeNode newdn, DaxeNode beforedn) {
assert(beforedn == null || this == beforedn.parent);
Expand All @@ -602,8 +602,12 @@ abstract class DaxeNode {
}
}

/**
* Inserts [newdn] as a child of this node after [afterdn].
* [afterdn] may not be null.
*/
void insertAfter(DaxeNode newdn, DaxeNode afterdn) {
assert(this == afterdn.parent);
assert(afterdn != null && this == afterdn.parent);
if (afterdn._nextSibling == null)
appendChild(newdn);
else
Expand Down

0 comments on commit 601e3e5

Please sign in to comment.