code: public static boolean isDescendantOf(SoyNode node, SoyNode ancestor) {
      for (; node != null; node = node.getParent()) {
        if (ancestor == node) {
          return true;
        }
      }
      return false;
    }
docs: Returns true if {@code node} is a descendant of {@code ancestor}.