src/com/google/javascript/rhino/Node.java
/**
   * Checks if the subtree under this node is the same as another subtree. Returns null if it's
   * equal, or a message describing the differences. Considers two nodes to be unequal if their
   * JSDocInfo doesn't match. Should be called with {@code this} as the "expected" node and {@code
   * actual} as the "actual" node.
   *
   * @see JSDocInfo#equals(Object)
   */
Checks if the subtree under this node is the same as another subtree. Returns null if it's
equal, or a message describing the differences. Considers two nodes to be unequal if their
JSDocInfo doesn't match. Should be called with  this as the "expected" node and {@code
actual} as the "actual" node.


Checks if the subtree under this node is the same as another subtree . Returns null if it ' s equal or a message describing the differences . Considers two nodes to be unequal if their JSDocInfo doesn ' t match . Should be called with this as the " expected " node and { @code actual } as the " actual " node .
@VisibleForTesting
  @Nullable
  public final String checkTreeEqualsIncludingJsDoc(Node actual) {
      NodeMismatch diff = checkTreeEqualsImpl(actual, true);
      if (diff != null) {
        if (diff.nodeActual.isEquivalentTo(diff.nodeExpected, false, true, false)) {
          String jsDocActual = diff.nodeActual.getJSDocInfo() == null ?
              "(none)" :
              diff.nodeActual.getJSDocInfo().toStringVerbose();
          String jsDocExpected = diff.nodeExpected.getJSDocInfo() == null ?
              "(none)" :
              diff.nodeExpected.getJSDocInfo().toStringVerbose();
          return "Node tree inequality:" +
              "\nTree:\n" + toStringTree() +
              "\n\nJSDoc differs on subtree: " + diff.nodeExpected +
              "\nExpected JSDoc: " + jsDocExpected +
              "\nActual JSDoc  : " + jsDocActual;
        }
        return "Node tree inequality:" +
            "\nExpected tree:\n" + toStringTree() +
            "\n\nActual tree:\n" + actual.toStringTree() +
            "\n\nExpected subtree: " + diff.nodeExpected.toStringTree() +
            "\n\nActual subtree: " + diff.nodeActual.toStringTree();
      }
      return null;
  }
@ VisibleForTesting @ Nullable public final String checkTreeEqualsIncludingJsDoc ( Node actual ) { NodeMismatch diff = checkTreeEqualsImpl ( actual , true ) ; if ( diff != null ) { if ( diff . nodeActual . isEquivalentTo ( diff . nodeExpected , false , true , false ) ) { String jsDocActual = diff . nodeActual . getJSDocInfo ( ) == null ? "(none)" : diff . nodeActual . getJSDocInfo ( ) . toStringVerbose ( ) ; String jsDocExpected = diff . nodeExpected . getJSDocInfo ( ) == null ? "(none)" : diff . nodeExpected . getJSDocInfo ( ) . toStringVerbose ( ) ; return "Node tree inequality:" + "\nTree:\n" + toStringTree ( ) + "\n\nJSDoc differs on subtree: " + diff . nodeExpected + "\nExpected JSDoc: " + jsDocExpected + "\nActual JSDoc  : " + jsDocActual ; } return "Node tree inequality:" + "\nExpected tree:\n" + toStringTree ( ) + "\n\nActual tree:\n" + actual . toStringTree ( ) + "\n\nExpected subtree: " + diff . nodeExpected . toStringTree ( ) + "\n\nActual subtree: " + diff . nodeActual . toStringTree ( ) ; } return null ; }
Checks if the subtree under this node is the same as another subtree.
Checks if the subtree under this node is the same as another subtree .
// The only difference is that the JSDoc is different on // the subtree.