Checks that a given identifier node is a reference or not.

This is used to detect the first throwable node in a `try` block.

@param {ASTNode} node - An Identifier node to check.
@returns {boolean} `true` if the node is a reference.
963960
function isIdentifierReference(node) {
    const parent = node.parent;

    switch (parent.type) {
        case "LabeledStatement":
        case "BreakStatement":
        case "ContinueStatement":
        case "ArrayPattern":
        case "RestElement":
        case "ImportSpecifier":
        case "ImportDefaultSpecifier":
        case "ImportNamespaceSpecifier":
        case "CatchClause":
            return false;

        case "FunctionDeclaration":
        case "FunctionExpression":
        case "ArrowFunctionExpression":
        case "ClassDeclaration":
        case "ClassExpression":
        case "VariableDeclarator":
            return parent.id !== node;

        case "Property":
        case "MethodDefinition":
            return (
                parent.key !== node ||
                parent.computed ||
                parent.shorthand
            );

        case "AssignmentPattern":
            return parent.key !== node;

        default:
            return true;
    }
}
1367594
function isInlineNode(node) {
        return dom.isCharacterDataNode(node) ||
                (node.nodeType == 1 && inlineDisplayRegex.test(getComputedStyleProperty(node, "display")));
    }
1214229
function isInternalNode (node) {
  let tagName = (typeof node === 'string') ? node : node.tagName
  if (tagName && tagName.toLowerCase().indexOf('mip-i-') === 0) {
    return true
  }

  if (node.tagName && (node.hasAttribute('placeholder') ||
      node.hasAttribute('fallback') ||
      node.hasAttribute('overflow'))) {
    return true
  }
  return false
}
193595
function checkFunction(node) {
            if (!node.generator) {
                return;
            }

            const starToken = getStarToken(node);
            const prevToken = sourceCode.getTokenBefore(starToken);
            const nextToken = sourceCode.getTokenAfter(starToken);

            let kind = "named";

            if (node.parent.type === "MethodDefinition" || (node.parent.type === "Property" && node.parent.method)) {
                kind = "method";
            } else if (!node.id) {
                kind = "anonymous";
            }

            // Only check before when preceded by `function`|`static` keyword
            if (!(kind === "method" && starToken === sourceCode.getFirstToken(node.parent))) {
                checkSpacing(kind, "before", prevToken, starToken);
            }

            checkSpacing(kind, "after", starToken, nextToken);
        }
226764
function(node){
    var nodeName = node.nodeName;
    while ((node = node.previousSibling)) if (node.nodeName == nodeName) return false;
    return true;
  }
1148221
function isNowAccess (node) {
  return nodeType(node, exactMatch(nodeTypes.IDENTIFIER)) &&
        expressionType(node, exactMatch(basicTypes.UINT)) &&
        name(node, exactMatch('now'))
}
204159
public boolean isAncestor(XMLNode node) {
		return node == parent || (parent != null && parent.isAncestor(node));
	}
1074866
function isIndependentType(node) {
            switch (node.kind) {
                case 117 /* AnyKeyword */:
                case 132 /* StringKeyword */:
                case 130 /* NumberKeyword */:
                case 120 /* BooleanKeyword */:
                case 133 /* SymbolKeyword */:
                case 103 /* VoidKeyword */:
                case 135 /* UndefinedKeyword */:
                case 93 /* NullKeyword */:
                case 127 /* NeverKeyword */:
                case 166 /* LiteralType */:
                    return true;
                case 160 /* ArrayType */:
                    return isIndependentType(node.elementType);
                case 155 /* TypeReference */:
                    return isIndependentTypeReference(node);
            }
            return false;
        }
24564
function(node) {

        var valid = true;
        // var n = (node.nodeName == "#text") ? node.parentNode : node;
        var nodeName;
        try {
            nodeName = node.nodeName.toUpperCase();
        } catch(e) {
            nodeName = node.nodeName;
        }
        valid = valid && !this.invalidHandleTypes[nodeName];
        valid = valid && !this.invalidHandleIds[node.id];

        for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {
            valid = !Dom.hasClass(node, this.invalidHandleClasses[i]);
        }

        this.logger.log("Valid handle? ... " + valid);

        return valid;

    }
761504
function (node) {
        var parent = node.parentNode;
        while (parent) {
            if (parent === this) {
                return true;
            }
            parent = parent.parentNode;
        }
        return false;
    }
1034033
function isBase(node, compareNode) {
            while (compareNode) {
                if (compareNode === node) {
                    return true;
                }

                compareNode = self.getBase(compareNode);
            }

            return false;
        }
1100489
function isIElementNode(node) {
    return typeof node['getText'] === 'function' &&
        typeof node.currently['hasText'] === 'function' &&
        typeof node.currently['hasAnyText'] === 'function' &&
        typeof node.currently['containsText'] === 'function' &&
        typeof node.wait['hasText'] === 'function' &&
        typeof node.wait['hasAnyText'] === 'function' &&
        typeof node.wait['containsText'] === 'function' &&
        typeof node.eventually['hasText'] === 'function' &&
        typeof node.eventually['hasAnyText'] === 'function' &&
        typeof node.eventually['containsText'] === 'function' &&
        typeof node['getDirectText'] === 'function' &&
        typeof node.currently['hasDirectText'] === 'function' &&
        typeof node.currently['hasAnyDirectText'] === 'function' &&
        typeof node.currently['containsDirectText'] === 'function' &&
        typeof node.wait['hasDirectText'] === 'function' &&
        typeof node.wait['hasAnyDirectText'] === 'function' &&
        typeof node.wait['containsDirectText'] === 'function' &&
        typeof node.eventually['hasDirectText'] === 'function' &&
        typeof node.eventually['hasAnyDirectText'] === 'function' &&
        typeof node.eventually['containsDirectText'] === 'function';
}
494414
function ReferencedIdentifier(node, parent, scope, state) {
    // we can't guarantee the purity of arguments
    if (node.name === "arguments") {
      state.deopted = true;
    }

    // is this a referenced identifier and is it referencing the rest parameter?
    if (node.name !== state.name) return;

    if (state.noOptimise) {
      state.deopted = true;
    } else {
      if (this.parentPath.isMemberExpression({ computed: true, object: node })) {
        // if we know that this member expression is referencing a number then we can safely
        // optimise it
        var prop = this.parentPath.get("property");
        if (prop.isBaseType("number")) {
          state.candidates.push(this);
          return;
        }
      }

      // optimise single spread args in calls
      if (this.parentPath.isSpreadElement() && state.offset === 0) {
        var call = this.parentPath.parentPath;
        if (call.isCallExpression() && call.node.arguments.length === 1) {
          state.candidates.push(this);
          return;
        }
      }

      state.references.push(this);
    }
  }
657907
static boolean isNameReferenced(Node node, String name, Predicate<Node> traverseChildrenPred) {
    return has(node, new MatchNameNode(name), traverseChildrenPred);
  }
638332
function check(node) {
		if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(node.arguments[0])) {
			var flags = isString(node.arguments[1]) ? node.arguments[1].value : "";

			if (allowedFlags) {
				flags = flags.replace(new RegExp("[" + allowedFlags + "]", "gi"), "");
			}

			try {
				void new RegExp(node.arguments[0].value);
			} catch (e) {
				context.report(node, e.message);
			}
			if (flags) {
				try {
					var result = parser.parse("/./" + flags, context.parserOptions);
					if (result.body.length > 0) {
						var expressionStatement = result.body[0];
						var regexp = expressionStatement.expression;
						if (regexp && regexp.value === null) {
							context.report(node, ProblemMessages.noInvalidRegexp, {
								arg: flags
							});
						}
					}
				} catch (ex) {
					context.report(node, ProblemMessages.noInvalidRegexp, {
						arg: flags
					});
				}
			}
		}
	}
874952
function isNullOrUndefined(node) {
		return (node.type === "Literal" && node.value === null) ||
			(node.type === "Identifier" && node.name === "undefined") ||
			(node.type === "UnaryExpression" && node.operator === "void");
	}
1233186
function isIgnore(node) {
            let target = node
            while (target.type === "HTMLElement") {
                if (options.ignoreNames.indexOf(target.name) >= 0) {
                    // ignore element name
                    return true
                }
                target = target.parent
            }
            return false
        }