checkMatchingParent static method

void checkMatchingParent(
  1. XmlParentable node,
  2. XmlNode parent
)

Ensure that node has a matching parent.

Implementation

static void checkMatchingParent(XmlParentable node, XmlNode parent) {
  if (node.parent != parent) {
    // If this exception is ever thrown, this is likely a bug in the internal
    // code of the library.
    throw XmlParentException('Node already has a non-matching parent: $node');
  }
}