Are the nodes equal for the purpose of inlining?
If type aware optimizations are on, type equality is checked.
324981
protected boolean areNodesEqualForInlining(Node n1, Node n2) {
    /* Our implementation delegates to the compiler. We provide this
     * method because we don't want to expose Compiler to PeepholeOptimizations.
     */
    checkNotNull(compiler);
    return compiler.areNodesEqualForInlining(n1, n2);
  }
341934
private void checkDestructuringAssignment(
      NodeTraversal t, Node nodeToWarn, Node pattern, JSType rightType, String msg) {
    for (DestructuredTarget target :
        DestructuredTarget.createAllNonEmptyTargetsInPattern(typeRegistry, rightType, pattern)) {

      // TODO(b/77597706): this is not very efficient because it re-infers the types below,
      // which we already did once in TypeInference. don't repeat the work.
      checkCanAssignToWithScope(
          t, nodeToWarn, target.getNode(), target.inferType(), /* info= */ null, msg);
    }
  }
85096
protected boolean equalElements(KTypeArrayDeque<?> other) {
    int max = size();
    if (other.size() != max) {
      return false;
    }

    Iterator<KTypeCursor<KType>> i1 = this.iterator();
    Iterator<? extends KTypeCursor<?>> i2 = other.iterator();

    while (i1.hasNext() && i2.hasNext()) {
      if (!Intrinsics.equals(this, i1.next().value, i2.next().value)) {
        return false;
      }
    }

    return !i1.hasNext() && 
           !i2.hasNext();
  }
295098
private boolean containsOnlyInfinitivesToTheLeft(AnalyzedTokenReadings[] tokens, int startPos) throws IOException {
    int infinitives = 0;
    for (int i = startPos; i > 0; i--) {
      String token = tokens[i].getToken();
      if (tokens[i].hasPartialPosTag("SUB:")) {
        AnalyzedTokenReadings lookup = tagger.lookup(token.toLowerCase());
        if (lookup != null && lookup.hasPosTagStartingWith("VER:INF")) {
          infinitives++;
        } else {
          return false;
        }
      }
    }
    return infinitives >= 2;
  }
966453
@Override
  public boolean visit(TypeDeclaration node) {
    TypeMirror serializableType = typeUtil.resolveJavaType("java.io.Serializable").asType();
    TypeMirror nodeType = node.getTypeElement().asType();
    boolean isSerializable = typeUtil.isAssignable(nodeType, serializableType);
    boolean stripReflection = !translationUtil.needsReflection(node.getTypeElement());
    return stripReflection && isSerializable;
  }
795223
private static boolean areEqualWithGenerics(ClassNode a, ClassNode b) {
        if (a==null) return b==null;
        if (!a.equals(b)) return false;
        if (a.isUsingGenerics() && !b.isUsingGenerics()) return false;
        GenericsType[] gta = a.getGenericsTypes();
        GenericsType[] gtb = b.getGenericsTypes();
        if (gta==null && gtb!=null) return false;
        if (gtb==null && gta!=null) return false;
        if (gta!=null && gtb!=null) {
            if (gta.length!=gtb.length) return false;
            for (int i = 0; i < gta.length; i++) {
                GenericsType ga = gta[i];
                GenericsType gb = gtb[i];
                boolean result = ga.isPlaceholder()==gb.isPlaceholder() && ga.isWildcard()==gb.isWildcard();
                result = result && ga.isResolved() && gb.isResolved();
                result = result && ga.getName().equals(gb.getName());
                result = result && areEqualWithGenerics(ga.getType(), gb.getType());
                result = result && areEqualWithGenerics(ga.getLowerBound(), gb.getLowerBound());
                if (result) {
                    ClassNode[] upA = ga.getUpperBounds();
                    if (upA!=null) {
                        ClassNode[] upB = gb.getUpperBounds();
                        if (upB==null || upB.length!=upA.length) return false;
                        for (int j = 0; j < upA.length; j++) {
                            if (!areEqualWithGenerics(upA[j],upB[j])) return false;
                        }
                    }
                }
                if (!result) return false;
            }
        }
        return true;
    }
267669
public static boolean isLeaf(GraphQLType type) {
        GraphQLUnmodifiedType unmodifiedType = unwrapAll(type);
        return
                unmodifiedType instanceof GraphQLScalarType
                        || unmodifiedType instanceof GraphQLEnumType;
    }
41275
function(type, node) {
    return seen.indexOf(node) == -1 && ((type == 'AssignmentExpression' && node.right == expr) || (type == 'VariableDeclarator' && node.init == expr));
  }
266681
function checkMemberSeparatorStyle(node) {
            const isInterface = node.type === "TSInterfaceBody";
            const isSingleLine = node.loc.start.line === node.loc.end.line;

            const members = isInterface ? node.body : node.members;

            const typeOpts = isInterface
                ? interfaceOptions
                : typeLiteralOptions;
            const opts = isSingleLine
                ? typeOpts.singleline
                : typeOpts.multiline;

            members.forEach((member, index) => {
                checkLastToken(member, opts, index === members.length - 1);
            });
        }
510376
private static boolean isAllPrimitiveTypes(IMethod mtd) {
    if (!mtd.getReturnType().isPrimitiveType()) return false;
    for (int i = (mtd.isStatic() ? 0 : 1); i < mtd.getNumberOfParameters(); i++) {
      if (!mtd.getParameterType(i).isPrimitiveType()) return false;
    }
    return true;
  }
462355
function innerEquiv( a, b ) {

		// We're done when there's nothing more to compare
		if ( arguments.length < 2 ) {
			return true;
		}

		// Require type-specific equality
		return ( a === b || typeEquiv( a, b ) ) &&

			// ...across all consecutive argument pairs
			( arguments.length === 2 || innerEquiv.apply( this, [].slice.call( arguments, 1 ) ) );
	}
898792
private static boolean _isAllOfSameType(Node[] nodes, short type) {
	for (int i = 0; i < nodes.length; i++) {
	    if (nodes[i].getNodeType() != type) return false;
	}
	return true;
    }
1222432
function compareAst(actualSrc, expectedSrc, options) {
	var actualAst, expectedAst;
	options = options || {};

	if (!options.comparators) {
		options.comparators = [];
	}

	/*
	 * A collection of comparator functions that recognize equivalent nodes
	 * that would otherwise be reported as unequal by simple object comparison.
	 * These may:
	 *
	 * - return `true` if the given nodes can be verified as equivalent with no
	 *   further processing
	 * - return an instance of MatchError if the nodes are verified as
	 *   uniquivalent
	 * - return any other value if equivalency cannot be determined
	 */
	Array.prototype.push.apply(options.comparators, [
		require('./comparators/fuzzy-identifiers')(options),
		require('./comparators/fuzzy-strings')(options)
	]);

	try {
		actualAst = parse(actualSrc).body;
	} catch(err) {
		throw new Errors.ParseError();
	}

	try {
		expectedAst = parse(expectedSrc).body;
	} catch (err) {
		throw new Errors.ParseError();
	}

	function _bind(actual, expected) {
		var attr;

		// Literal values
		if (Object(actual) !== actual) {
			if (actual !== expected) {
				throw new Errors.MatchError(actualAst, expectedAst);
			}
			return;
		}

		// Arrays
		if (Array.isArray(actual)) {
			if (actual.length !== expected.length) {
				throw new Errors.MatchError(actualAst, expectedAst);
			}
			actual.forEach(function(_, i) {
				_bind(actual[i], expected[i]);
			});
			return;
		}

		// Nodes

		normalizeMemberExpr(actual);
		normalizeMemberExpr(expected);

		if (checkEquivalency(options.comparators, actual, expected)) {
			return;
		}

		// Either remove attributes or recurse on their values
		for (attr in actual) {
			if (expected && attr in expected) {
				_bind(actual[attr], expected[attr]);
			} else {
				throw new Errors.MatchError(actualAst, expectedAst);
			}
		}
	}

	// Start recursing on the ASTs from the top level.
	_bind(actualAst, expectedAst);

	return null;
}
842792
private static boolean expressionsEqual(ExpressionTree expr1, ExpressionTree expr2) {
    if (!expr1.getKind().equals(expr2.getKind())) {
      return false;
    }

    if (!expr1.getKind().equals(Kind.ARRAY_ACCESS)
        && !expr1.getKind().equals(Kind.IDENTIFIER)
        && !(expr1 instanceof LiteralTree)) {
      return false;
    }

    if (expr1.getKind() == Kind.ARRAY_ACCESS) {
      ArrayAccessTree arrayAccessTree1 = (ArrayAccessTree) expr1;
      ArrayAccessTree arrayAccessTree2 = (ArrayAccessTree) expr2;
      return expressionsEqual(arrayAccessTree1.getExpression(), arrayAccessTree2.getExpression())
          && expressionsEqual(arrayAccessTree1.getIndex(), arrayAccessTree2.getIndex());
    }

    if (expr1 instanceof LiteralTree) {
      LiteralTree literalTree1 = (LiteralTree) expr1;
      LiteralTree literalTree2 = (LiteralTree) expr2;
      return literalTree1.getValue().equals(literalTree2.getValue());
    }

    return Objects.equal(ASTHelpers.getSymbol(expr1), ASTHelpers.getSymbol(expr2));
  }
414154
def is_probably_builtin(node):
    
    prev = node.prev_sibling
    if prev is not None and prev.type == token.DOT:
        # Attribute lookup.
        return False
    parent = node.parent
    if parent.type in (syms.funcdef, syms.classdef):
        return False
    if parent.type == syms.expr_stmt and parent.children[0] is node:
        # Assignment.
        return False
    if parent.type == syms.parameters or \
            (parent.type == syms.typedargslist and (
            (prev is not None and prev.type == token.COMMA) or
            parent.children[0] is node
            )):
        # The name of an argument.
        return False
    return True
278405
function isConstantFunction (node) {
  return isFunctionDefinition(node) && (
    node.attributes.constant === true ||
    node.attributes.stateMutability === 'view' ||
    node.attributes.stateMutability === 'pure'
  )
}
144250
private void checkReferenceEquality(Node n, String typeName, String fileName) {
    if (n.getToken() == Token.SHEQ
        || n.getToken() == Token.EQ
        || n.getToken() == Token.SHNE
        || n.getToken() == Token.NE) {
      JSType firstJsType = n.getFirstChild().getJSType();
      JSType lastJsType = n.getLastChild().getJSType();
      boolean hasType = isType(firstJsType, fileName) || isType(lastJsType, fileName);
      boolean hasNullType = isNullType(firstJsType) || isNullType(lastJsType);
      if (hasType && !hasNullType) {
        compiler.report(JSError.make(n, J2CL_REFERENCE_EQUALITY, typeName));
      }
    }
  }