Uses of Class
com.google.javascript.rhino.Node
-
-
Uses of Node in com.google.javascript.jscomp
Methods in com.google.javascript.jscomp that return Node Modifier and Type Method Description static Node
NodeUtil. emptyFunction()
protected Node
Compiler. ensureLibraryInjected(java.lang.String resourceName, boolean force)
static Node
NodeUtil. findPreorder(Node node, com.google.common.base.Predicate<Node> pred, com.google.common.base.Predicate<Node> traverseChildrenPred)
Returns the first Node matching the given pred via a pre-order traversal.static Node
AstManipulations. fuseExpressions(Node exp1, Node exp2)
Returns a single node equivalent to executing<expr1, expr2>
.static Node
NodeUtil. getAssignedValue(Node n)
For an assignment or variable declaration get the assigned value.Node
CompilerInput. getAstRoot(AbstractCompiler compiler)
Node
JsAst. getAstRoot(AbstractCompiler compiler)
Node
RecoverableJsAst. getAstRoot(AbstractCompiler compiler)
Node
SourceAst. getAstRoot(AbstractCompiler compiler)
Gets the root node of the AST for the source file this represents.static Node
NodeUtil. getBestJSDocInfoNode(Node n)
static Node
NodeUtil. getBestLValue(Node n)
Find the l-value that the given r-value is being assigned to.static Node
NodeUtil. getCallTargetResolvingIndirectCalls(Node call)
Returns the call target for a call expression, resolving an indirected call (`(0, foo)()`) if present.static Node
NodeUtil. getClassMembers(Node n)
Node
NodeTraversal. getClosestHoistScopeRoot()
Node
DestructuredTarget. getComputedProperty()
Returns a COMPUTED_PROP node or nullNode
NodeTraversal. getCurrentNode()
Returns the node currently being traversed.Node
SymbolTable.Symbol. getDeclarationNode()
static Node
NodeUtil. getDeclaringParent(Node targetNode)
Returns the node that is effectively declaring the given target.Node
DestructuredTarget. getDefaultValue()
static Node
NodeUtil. getEnclosingBlock(Node n)
Finds the block containing the given node.static Node
NodeUtil. getEnclosingBlockScopeRoot(Node n)
static Node
NodeUtil. getEnclosingClass(Node n)
Finds the class containing the given node.Node
NodeTraversal. getEnclosingFunction()
Examines the functions stack for the last instance of a function node.static Node
NodeUtil. getEnclosingFunction(Node n)
Finds the function containing the given node.static Node
NodeUtil. getEnclosingModuleIfPresent(Node n)
static Node
NodeUtil. getEnclosingNode(Node n, com.google.common.base.Predicate<Node> pred)
static Node
NodeUtil. getEnclosingScopeRoot(Node n)
static Node
NodeUtil. getEnclosingScript(Node n)
Finds the script containing the given node.static Node
NodeUtil. getEnclosingStatement(Node n)
static Node
NodeUtil. getEnclosingType(Node n, Token type)
Gets the closest ancestor to the given node of the provided type.static Node
NodeUtil. getEs6ClassConstructorMemberFunctionDef(Node classNode)
protected Node
Compiler. getExternsRoot()
static Node
NodeUtil. getFunctionBody(Node fn)
Return a BLOCK node for the given FUNCTION node.static Node
NodeUtil. getFunctionParameters(Node fnNode)
Node
AbstractVar. getInitialValue()
protected Node
Compiler. getJsRoot()
abstract Node
TypeMismatch. getLocation()
The location of the assignment.static Node
NodeUtil. getLoopCodeBlock(Node n)
Node
JsMessageDefinition. getMessageNode()
Node
AbstractVar. getNameNode()
static Node
NodeUtil. getNameNode(Node n)
Gets the node of a function or class's name.Node
AbstractVar. getNode()
Node
DestructuredTarget. getNode()
Node
ImplicitNullabilityCheck.Result. getNode()
abstract Node
JSError. getNode()
Node where the warning occurred.Node
Reference. getNode()
protected Node
Compiler. getNodeForCodeInsertion(JSChunk module)
Node
AbstractVar. getParentNode()
abstract Node
AbstractCompiler. getRoot()
Returns the root node of the AST, which includes both externs and source.Node
Compiler. getRoot()
Node
AbstractScope. getRootNode()
Gets the container node of the scope.static Node
NodeUtil. getRootOfQualifiedName(Node qName)
Gets the root node of a qualified name.static Node
NodeUtil. getRootTarget(Node targetNode)
Returns the outermost target enclosing the given assignment target.static Node
NodeUtil. getRValueOfLValue(Node n)
Gets the r-value (or initializer) of a node returned by getBestLValue.Node
AbstractVar. getScopeRoot()
Node
NodeTraversal. getScopeRoot()
Returns the current scope's root.abstract Node
AbstractCompiler. getScriptNode(java.lang.String filename)
Node
Compiler. getScriptNode(java.lang.String filename)
Node
DestructuredTarget. getStringKey()
Returns a STRING_KEY node or nullstatic Node
NodeUtil. newDeclaration(Node lhs, Node rhs, Token declarationType)
static Node
NodeUtil. newPropertyAccess(AbstractCompiler compiler, Node context, java.lang.String name)
Creates a property access on thecontext
tree.static Node
NodeUtil. newQName(AbstractCompiler compiler, java.lang.String name)
Creates a node representing a qualified name.static Node
NodeUtil. newQNameDeclaration(AbstractCompiler compiler, java.lang.String name, Node value, JSDocInfo info)
Creates a node representing a qualified name.static Node
NodeUtil. newQNameDeclaration(AbstractCompiler compiler, java.lang.String name, Node value, JSDocInfo info, Token type)
Creates a node representing a qualified name.static Node
NodeUtil. newUndefinedNode(Node srcReferenceNode)
Create a node for an empty result expression: "void 0"Node
Compiler. parse(SourceFile file)
abstract Node
AbstractCompiler. parseSyntheticCode(java.lang.String filename, java.lang.String code)
Parses code for injecting, and associate it with a given source file.Node
Compiler. parseSyntheticCode(java.lang.String fileName, java.lang.String js)
Methods in com.google.javascript.jscomp that return types with arguments of type Node Modifier and Type Method Description static java.util.List<Node>
NodeUtil. findLhsNodesInNode(Node assigningParent)
Retrieves lhs nodes declared or assigned in a given assigning parent node.java.util.Collection<Node>
SymbolTable. getAllJSDocInfoNodes()
static ControlFlowGraph<Node>
ControlFlowAnalysis. getCfg(AbstractCompiler compiler, Node cfgRoot)
ControlFlowGraph<Node>
NodeTraversal. getControlFlowGraph()
Gets the control flow graph for the current JS scope.com.google.common.collect.ImmutableMap<java.lang.String,Node>
CompilerOptions. getDefineReplacements()
Returns the map of define replacements.com.google.common.collect.ImmutableSetMultimap<JSType,Node>
InvalidatingTypes. getMismatchLocations()
static java.util.List<Node>
NodeUtil. getParentChangeScopeNodes(java.util.List<Node> scopeNodes)
Returns the list of scope nodes which are parents of the provided list of scope nodes.java.util.Map<java.lang.String,Node>
TemplateAstMatcher. getTemplateNodeToMatchMap()
Returns a map from named template Nodes (such as parameters or local variables) to Nodes that were matches from the last matched template.static com.google.common.collect.ImmutableSet<Node>
ConformanceAllowlister. getViolatingNodes(Compiler compiler, Node externs, Node ast, com.google.javascript.jscomp.Requirement requirement)
static java.lang.Iterable<Node>
NodeUtil. preOrderIterable(Node root)
Same asNodeUtil.preOrderIterable(Node, Predicate)
but iterates over all nodes in the tree without exception.static java.lang.Iterable<Node>
NodeUtil. preOrderIterable(Node root, com.google.common.base.Predicate<Node> travserseNodePredicate)
Create anIterable
over the given node and all descendents.static java.util.List<Node>
NodeUtil. removeNestedChangeScopeNodes(java.util.List<Node> scopeNodes)
Removes any scope nodes from the provided list that are nested within some other scope node also in the list.Methods in com.google.javascript.jscomp with parameters of type Node Modifier and Type Method Description protected void
CodeGenerator. add(Node n)
protected void
CodeGenerator. add(Node node, CodeGenerator.Context context)
void
SourceMap. addMapping(Node node, FilePosition outputStartPosition, FilePosition outputEndPosition)
static boolean
NodeUtil. canMergeBlock(Node block)
A check inside a block to see if there are const, let, class, or function declarations to be safe and not hoist them into the upper block.void
CheckConformance.Rule. check(NodeTraversal t, Node n)
Perform conformance checkvoid
ConformanceRules.AbstractRule. check(NodeTraversal t, Node n)
protected abstract ConformanceRules.ConformanceResult
ConformanceRules.AbstractRule. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanCreateDom. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanCreateElement. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanExecCommand. checkConformance(NodeTraversal traversal, Node node)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanForOf. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanGlobalVars. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.BannedEnhance. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanNullDeref. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanSetAttribute. checkConformance(NodeTraversal traversal, Node node)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanStaticThis. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanThrowOfNonErrorTypes. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanUnknownDirectThisPropsReferences. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanUnknownThis. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanUnknownTypedClassPropsReferences. checkConformance(NodeTraversal t, Node getprop)
protected ConformanceRules.ConformanceResult
ConformanceRules.BanUnresolvedType. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.RequireUseStrict. checkConformance(NodeTraversal t, Node n)
protected ConformanceRules.ConformanceResult
ConformanceRules.StrictBanUnresolvedType. checkConformance(NodeTraversal t, Node n)
void
CodingConvention. checkForCallingConventionDefinitions(Node getPropNode, java.util.Map<java.lang.String,java.lang.String> delegateCallingConventions)
Checks for getprops that set the calling conventions on delegate methods.void
CodingConventions.Proxy. checkForCallingConventionDefinitions(Node n, java.util.Map<java.lang.String,java.lang.String> delegateCallingConventions)
protected void
JsMessageVisitor. checkNode(Node node, Token type)
Checks a node's type.static com.google.common.collect.ImmutableSet<java.lang.String>
NodeUtil. collectExternVariableNames(AbstractCompiler compiler, Node externs)
static com.google.common.collect.ImmutableList<DestructuredTarget>
DestructuredTarget. createAllNonEmptyTargetsInPattern(JSTypeRegistry registry, com.google.common.base.Supplier<JSType> patternType, Node pattern)
Returns all the targets directly in the given pattern, except for EMPTY nodesstatic com.google.common.collect.ImmutableList<DestructuredTarget>
DestructuredTarget. createAllNonEmptyTargetsInPattern(JSTypeRegistry registry, JSType patternType, Node pattern)
Returns all the targets directly in the given pattern, except for EMPTY nodesScope
SyntacticScopeCreator. createScope(Node n, AbstractScope<?,?> parent)
Scope
SyntacticScopeCreator. createScope(Node n, Scope parent)
static boolean
CodingConventions. defaultIsFunctionCallThatAlwaysThrows(Node n, java.lang.String alwaysThrowsFunctionName)
SymbolTable.Reference
SymbolTable.Symbol. defineReferenceAt(Node n)
static void
NodeUtil. deleteChildren(Node n, AbstractCompiler compiler)
Permanently delete all the children of the given node, including reporting changes.static void
NodeUtil. deleteFunctionCall(Node n, AbstractCompiler compiler)
Permanently delete the given call from the AST while maintaining a valid node structure, as well as report the related AST changes to the given compiler.static void
NodeUtil. deleteNode(Node n, AbstractCompiler compiler)
Permanently delete the given node from the AST, as well as report the related AST changes/deletions to the given compiler.CodingConvention.Cache
ClosureCodingConvention. describeCachingCall(Node node)
CodingConvention.Cache
CodingConvention. describeCachingCall(Node node)
Builds aCodingConvention.Cache
instance from the given call node and returns that instance, or null if theNode
does not resemble a cache utility call.CodingConvention.Cache
CodingConventions.Proxy. describeCachingCall(Node node)
CodingConvention.Bind
ClosureCodingConvention. describeFunctionBind(Node n, boolean callerChecksTypes, boolean iCheckTypes)
CodingConvention.Bind
CodingConvention. describeFunctionBind(Node n)
A Bind instance or null.CodingConvention.Bind
CodingConvention. describeFunctionBind(Node n, boolean callerChecksTypes, boolean iCheckTypes)
A Bind instance or null.CodingConvention.Bind
CodingConventions.Proxy. describeFunctionBind(Node n)
CodingConvention.Bind
CodingConventions.Proxy. describeFunctionBind(Node n, boolean callerChecksTypes, boolean iCheckTypes)
void
ClosureCheckModule. enterModule(ModuleMetadataMap.ModuleMetadata currentModule, Node moduleScopeRoot)
protected void
NodeTraversal.AbstractModuleCallback. enterModule(ModuleMetadataMap.ModuleMetadata currentModule, Node moduleScopeRoot)
Called when the traversal enters a global file or module.void
ClosureCheckModule. exitModule(ModuleMetadataMap.ModuleMetadata currentModule, Node moduleScopeRoot)
protected void
NodeTraversal.AbstractModuleCallback. exitModule(ModuleMetadataMap.ModuleMetadata oldModule, Node moduleScopeRoot)
Called when the traversal exits a global file or module.java.lang.String
ClosureCodingConvention. extractClassNameIfProvide(Node node, Node parent)
Extracts X from goog.provide('X'), if the applied Node is goog.java.lang.String
CodingConvention. extractClassNameIfProvide(Node node, Node parent)
Convenience method for determining provided dependencies amongst different JS scripts.java.lang.String
CodingConventions.Proxy. extractClassNameIfProvide(Node node, Node parent)
java.lang.String
ClosureCodingConvention. extractClassNameIfRequire(Node node, Node parent)
Extracts X from goog.require('X'), if the applied Node is goog.java.lang.String
CodingConvention. extractClassNameIfRequire(Node node, Node parent)
Convenience method for determining required dependencies amongst different JS scripts.java.lang.String
CodingConventions.Proxy. extractClassNameIfRequire(Node node, Node parent)
boolean
ClosureCodingConvention. extractIsModuleFile(Node node, Node parent)
boolean
CodingConvention. extractIsModuleFile(Node node, Node parent)
Convenience method for determining if the node indicates the file is a "module" file (a file whose top level symbols are not in global scope).boolean
CodingConventions.Proxy. extractIsModuleFile(Node node, Node parent)
static java.util.List<Node>
NodeUtil. findLhsNodesInNode(Node assigningParent)
Retrieves lhs nodes declared or assigned in a given assigning parent node.static Node
NodeUtil. findPreorder(Node node, com.google.common.base.Predicate<Node> pred, com.google.common.base.Predicate<Node> traverseChildrenPred)
Returns the first Node matching the given pred via a pre-order traversal.static ReplaceMessages.ProtectedJsMessage
ReplaceMessages.ProtectedJsMessage. fromAstNode(Node node, JsMessage.IdGenerator idGenerator)
static Node
AstManipulations. fuseExpressions(Node exp1, Node exp2)
Returns a single node equivalent to executing<expr1, expr2>
.static Node
NodeUtil. getAssignedValue(Node n)
For an assignment or variable declaration get the assigned value.static JSDocInfo
NodeUtil. getBestJSDocInfo(Node n)
Find the best JSDoc for the given node.static Node
NodeUtil. getBestJSDocInfoNode(Node n)
static Node
NodeUtil. getBestLValue(Node n)
Find the l-value that the given r-value is being assigned to.static java.lang.String
NodeUtil. getBestLValueName(Node lValue)
Get the name of the given l-value node.static Node
NodeUtil. getCallTargetResolvingIndirectCalls(Node call)
Returns the call target for a call expression, resolving an indirected call (`(0, foo)()`) if present.static ControlFlowGraph<Node>
ControlFlowAnalysis. getCfg(AbstractCompiler compiler, Node cfgRoot)
CodingConvention.SubclassRelationship
ClosureCodingConvention. getClassesDefinedByCall(Node callNode)
Checks if the given method defines a subclass relationship, and if it does, returns information on that relationship.CodingConvention.SubclassRelationship
CodingConvention. getClassesDefinedByCall(Node callNode)
Checks if the given method defines a subclass relationship, and if it does, returns information on that relationship.CodingConvention.SubclassRelationship
CodingConventions.Proxy. getClassesDefinedByCall(Node callNode)
static Node
NodeUtil. getClassMembers(Node n)
java.lang.String
ProcessCommonJSModules. getCommonJsImportPath(Node requireCall)
static java.lang.String
ProcessCommonJSModules. getCommonJsImportPath(Node requireCall, ModuleLoader.ResolutionMode resolutionMode)
static com.google.common.collect.ImmutableList<JSError>
ConformanceAllowlister. getConformanceErrors(Compiler compiler, Node externs, Node ast, com.google.javascript.jscomp.Requirement requirement)
static int
NodeUtil. getCount(Node n, com.google.common.base.Predicate<Node> pred, com.google.common.base.Predicate<Node> traverseChildrenPred)
static JSTypeExpression
NodeUtil. getDeclaredTypeExpression(Node declaration)
Return declared JSDoc type for the given name declaration, or null if none present.static Node
NodeUtil. getDeclaringParent(Node targetNode)
Returns the node that is effectively declaring the given target.CodingConvention.DelegateRelationship
CodingConvention. getDelegateRelationship(Node callNode)
CodingConvention.DelegateRelationship
CodingConventions.Proxy. getDelegateRelationship(Node callNode)
static Node
NodeUtil. getEnclosingBlock(Node n)
Finds the block containing the given node.static Node
NodeUtil. getEnclosingBlockScopeRoot(Node n)
static Node
NodeUtil. getEnclosingClass(Node n)
Finds the class containing the given node.static Node
NodeUtil. getEnclosingFunction(Node n)
Finds the function containing the given node.SymbolTable.SymbolScope
SymbolTable. getEnclosingFunctionScope(Node n)
Gets the scope that contains the given node.static Node
NodeUtil. getEnclosingModuleIfPresent(Node n)
static Node
NodeUtil. getEnclosingNode(Node n, com.google.common.base.Predicate<Node> pred)
SymbolTable.SymbolScope
SymbolTable. getEnclosingScope(Node n)
Gets the scope that contains the given node.static Node
NodeUtil. getEnclosingScopeRoot(Node n)
static Node
NodeUtil. getEnclosingScript(Node n)
Finds the script containing the given node.static Node
NodeUtil. getEnclosingStatement(Node n)
static Node
NodeUtil. getEnclosingType(Node n, Token type)
Gets the closest ancestor to the given node of the provided type.static Node
NodeUtil. getEs6ClassConstructorMemberFunctionDef(Node classNode)
static Node
NodeUtil. getFunctionBody(Node fn)
Return a BLOCK node for the given FUNCTION node.static Node
NodeUtil. getFunctionParameters(Node fnNode)
static InputId
NodeUtil. getInputId(Node n)
static NodeUtil.ValueType
NodeUtil. getKnownValueType(Node n)
Evaluate a node's token and attempt to determine which primitive value type it could resolve to Without proper type information some assumptions had to be made for operations that could result in a BigInt or a Number.static Node
NodeUtil. getLoopCodeBlock(Node n)
static java.lang.String
NodeUtil. getName(Node n)
static Node
NodeUtil. getNameNode(Node n)
Gets the node of a function or class's name.static java.lang.String
NodeUtil. getNearestFunctionName(Node n)
Gets the function's name.CodingConvention.ObjectLiteralCast
ClosureCodingConvention. getObjectLiteralCast(Node callNode)
CodingConvention.ObjectLiteralCast
CodingConvention. getObjectLiteralCast(Node callNode)
Checks if the given method performs a object literal cast, and if it does, returns information on the cast.CodingConvention.ObjectLiteralCast
CodingConventions.Proxy. getObjectLiteralCast(Node callNode)
static void
NodeUtil. getParamOrPatternNames(Node n, java.util.function.Consumer<Node> cb)
Callscb
with all NAMEs declared in a PARAM_LIST or destructuring pattern.static Node
NodeUtil. getRootOfQualifiedName(Node qName)
Gets the root node of a qualified name.static Node
NodeUtil. getRootTarget(Node targetNode)
Returns the outermost target enclosing the given assignment target.static Node
NodeUtil. getRValueOfLValue(Node n)
Gets the r-value (or initializer) of a node returned by getBestLValue.java.lang.String
ChromeCodingConvention. getSingletonGetterClassName(Node callNode)
java.lang.String
ClosureCodingConvention. getSingletonGetterClassName(Node callNode)
java.lang.String
CodingConvention. getSingletonGetterClassName(Node callNode)
Checks if the given method defines a singleton getter, and if it does, returns the name of the class with the singleton getter.java.lang.String
CodingConventions.Proxy. getSingletonGetterClassName(Node callNode)
static StaticSourceFile
NodeUtil. getSourceFile(Node n)
static java.lang.String
NodeUtil. getSourceName(Node n)
static java.lang.String
NodeUtil. getStringValue(Node n)
Gets the value of a node as a String, or null if it cannot be converted.static com.google.common.collect.ImmutableSet<Node>
ConformanceAllowlister. getViolatingNodes(Compiler compiler, Node externs, Node ast, com.google.javascript.jscomp.Requirement requirement)
static com.google.common.collect.ImmutableSet<java.lang.String>
ConformanceAllowlister. getViolatingPaths(Compiler compiler, Node externs, Node ast, com.google.javascript.jscomp.Requirement requirement)
void
AstValidator.ViolationHandler. handleViolation(java.lang.String message, Node n)
static boolean
NodeUtil. has(Node node, com.google.common.base.Predicate<Node> pred, com.google.common.base.Predicate<Node> traverseChildrenPred)
java.util.List<java.lang.String>
ClosureCodingConvention. identifyTypeDeclarationCall(Node n)
java.util.List<java.lang.String>
CodingConvention. identifyTypeDeclarationCall(Node n)
Checks if the given CALL node is forward-declaring any types, and returns the name of the types if it is.java.util.List<java.lang.String>
CodingConventions.Proxy. identifyTypeDeclarationCall(Node n)
static boolean
NodeUtil. isAnyFor(Node n)
static boolean
NodeUtil. isAssignmentOp(Node n)
Returns true if the operator is an assignment type operator.static boolean
NodeUtil. isBigIntResult(Node n)
Returns true if the result of node evaluation is always a bigintstatic boolean
NodeUtil. isBlocklessArrowFunctionResult(Node n)
static boolean
NodeUtil. isBooleanResult(Node n)
static boolean
ControlFlowAnalysis. isBreakTarget(Node target, java.lang.String label)
Checks if target is actually the break target of labeled continue.static boolean
NodeUtil. isCallOrNew(Node node)
static boolean
NodeUtil. isCallTo(Node n, Node targetMethod)
A faster version ofNodeUtil.isCallTo(Node, String)
.static boolean
NodeUtil. isCallTo(Node n, java.lang.String qualifiedName)
static boolean
NodeUtil. isClassDeclaration(Node n)
Is this a class declaration.boolean
ClosureCodingConvention. isClassFactoryCall(Node callNode)
boolean
CodingConvention. isClassFactoryCall(Node callNode)
Checks if the given method is a call to a class factory, such a factory returns a unique class.boolean
CodingConventions.Proxy. isClassFactoryCall(Node callNode)
boolean
GoogleCodingConvention. isClassFactoryCall(Node callNode)
static boolean
ProcessCommonJSModules. isCommonJsDynamicImportCallback(Node n, ModuleLoader.ResolutionMode resolutionMode)
Recognize if a node is a dynamic module import.static boolean
ProcessCommonJSModules. isCommonJsExport(NodeTraversal t, Node export, ModuleLoader.ResolutionMode resolutionMode)
Recognize if a node is a module export.boolean
ProcessCommonJSModules. isCommonJsImport(Node requireCall)
static boolean
ProcessCommonJSModules. isCommonJsImport(Node requireCall, ModuleLoader.ResolutionMode resolutionMode)
Recognize if a node is a module import.static boolean
NodeUtil. isCompoundAssignmentOp(Node n)
static boolean
NodeUtil. isControlStructure(Node n)
Determines whether the given node is a FOR, DO, WHILE, WITH, or IF node.static boolean
NodeUtil. isDeclarationLValue(Node n)
Determines whether this node is used as an L-value that is a declaration.static boolean
NodeUtil. isEmptyBlock(Node block)
Returns whether this a BLOCK node with no children.static boolean
NodeUtil. isEnhancedFor(Node n)
static boolean
ControlFlowGraph. isEnteringNewCfgNode(Node n)
static boolean
NodeUtil. isEs6Constructor(Node fnNode)
static boolean
NodeUtil. isEs6ConstructorMemberFunctionDef(Node memberFunctionDef)
static boolean
Es6RewriteModules. isEs6ModuleRoot(Node scriptNode)
Return whether or not the given script node represents an ES6 module file.static boolean
NodeUtil. isExprCall(Node n)
Is this node a call expression statement?static boolean
NodeUtil. isExpressionResultUsed(Node expr)
static boolean
NodeUtil. isFromTypeSummary(Node n)
Determine if the given SCRIPT is a @typeSummary file, like an i.js fileboolean
ClosureCodingConvention. isFunctionCallThatAlwaysThrows(Node n)
boolean
CodingConvention. isFunctionCallThatAlwaysThrows(Node n)
Used by CheckMissingReturn.boolean
CodingConventions.Proxy. isFunctionCallThatAlwaysThrows(Node n)
static boolean
NodeUtil. isFunctionDeclaration(Node n)
Is this node a function declaration? A function declaration is a function that has a name that is added to the current scope (i.e.static boolean
NodeUtil. isGoogModuleCall(Node n)
static boolean
NodeUtil. isGoogProvideCall(Node n)
static boolean
NodeUtil. isHoistedFunctionDeclaration(Node n)
Is this node a hoisted function declaration? A function declaration in the scope root is hoisted to the top of the scope.static boolean
NodeUtil. isImportedName(Node n)
static boolean
NodeUtil. isInFunction(Node n)
boolean
CodingConvention. isInlinableFunction(Node n)
boolean
CodingConventions.Proxy. isInlinableFunction(Node n)
static boolean
NodeUtil. isLhsByDestructuring(Node n)
Returns true if the node is a lhs value of a destructuring assignment.static boolean
NodeUtil. isLhsOfAssign(Node n)
static boolean
NodeUtil. isLiteralValue(Node n, boolean includeFunctions)
Returns true if this is a literal value.static boolean
NodeUtil. isLogicalAssignmentOp(Node n)
Returns true if the operator is a logical assignment type operator.static boolean
NodeUtil. isLoopStructure(Node n)
Determines whether the given node is a FOR, DO, or WHILE node.static boolean
NodeUtil. isLValue(Node n)
Determines whether this node is used as an L-value.static boolean
NodeUtil. isMethodDeclaration(Node n)
Is this node a class or object literal member function?static boolean
NodeUtil. isNameDeclaration(Node n)
Is this node a name declaration?static boolean
NodeUtil. isNameDeclOrSimpleAssignLhs(Node n, Node parent)
Determines whether this node is strictly on the left hand side of an assign or var initialization.static boolean
NodeUtil. isNamedExportsLiteral(Node objectLiteral)
Whether this is an assignment to 'exports' that creates named exports.static boolean
NodeUtil. isNamespaceDecl(Node n)
Returns true iff this node defines a namespace, e.g.,static boolean
NodeUtil. isNormalGet(Node n)
Is this a GETPROP or GETELEM node?static boolean
NodeUtil. isNormalOrOptChainCall(Node n)
Is this a CALL or OPTCHAIN_CALL?static boolean
NodeUtil. isNormalOrOptChainGet(Node n)
Is this a GETPROP, OPTCHAIN_GETPROP, GETELEM, or OPTCHAIN_GETELEM?static boolean
NodeUtil. isNormalOrOptChainGetProp(Node n)
Is this a GETPROP or OPTCHAIN_GETPROP?static boolean
NodeUtil. isNullOrUndefined(Node n)
static boolean
NodeUtil. isNumericResult(Node n)
Returns true if the result of node evaluation is always a numberstatic boolean
NodeUtil. isObjectDefinePropertiesDefinition(Node n)
Returnstrue
if the node is a definition with Object.definePropertiesstatic boolean
NodeUtil. isObjectResult(Node n)
static boolean
NodeUtil. isObjLitProperty(Node node)
Returns true if the node is a property of an object literal.static boolean
NodeUtil. isOptChainGet(Node n)
Is this an OPTCHAIN_GETPROP or OPTCHAIN_GETELEM node?static boolean
NodeUtil. isOptChainNode(Node n)
Is this a OPTCHAIN_GETPROP, OPTCHAIN_GETELEM, OPTCHAIN_CALL node?boolean
CodingConvention. isOptionalParameter(Node parameter)
This checks whether a given parameter name should be treated as an optional parameter as far as type checking or function call arg count checking is concerned.boolean
CodingConventions.Proxy. isOptionalParameter(Node parameter)
boolean
GoogleCodingConvention. isOptionalParameter(Node parameter)
This checks whether a given parameter name should be treated as an optional parameter as far as type checking or function call arg count checking is concerned.boolean
ClosureCodingConvention. isPropertyRenameFunction(Node nameNode)
boolean
CodingConvention. isPropertyRenameFunction(Node nameNode)
Whether this GETPROP or NAME node is the function is returning the string name for a property, but allows renaming.boolean
CodingConventions.Proxy. isPropertyRenameFunction(Node nameNode)
boolean
ClosureCodingConvention. isPropertyTestFunction(Node call)
boolean
CodingConvention. isPropertyTestFunction(Node call)
Whether this CALL function is testing for the existence of a property.boolean
CodingConventions.Proxy. isPropertyTestFunction(Node call)
boolean
CodingConvention. isPrototypeAlias(Node getProp)
Whether this GETPROP node is an alias for an object prototype.boolean
CodingConventions.Proxy. isPrototypeAlias(Node getProp)
static boolean
NodeUtil. isPrototypePropertyDeclaration(Node n)
static boolean
NodeUtil. isStatement(Node n)
static boolean
NodeUtil. isStatementBlock(Node n)
static boolean
NodeUtil. isStatementParent(Node parent)
static boolean
SourceInformationAnnotator. isStringNodeRequiringOriginalName(Node node)
Whether JSCompiler attempts to preserve the original string attached to this node on the AST post-mangling and in source maps.static boolean
NodeUtil. isStringResult(Node n)
static boolean
NodeUtil. isTopLevel(Node n)
static boolean
NodeUtil. isUndefined(Node n)
boolean
CodingConvention. isVarArgsParameter(Node parameter)
This checks whether a given parameter should be treated as a marker for a variable argument list function.boolean
CodingConventions.Proxy. isVarArgsParameter(Node parameter)
boolean
GoogleCodingConvention. isVarArgsParameter(Node parameter)
static JSError
JSError. make(Node n, CheckLevel level, DiagnosticType type, java.lang.String... arguments)
Creates a JSError from a file and Node position.static JSError
JSError. make(Node n, DiagnosticType type, java.lang.String... arguments)
Creates a JSError from a file and Node position.static void
NodeUtil. markFunctionsDeleted(Node node, AbstractCompiler compiler)
Recurses through a tree, marking all function nodes deleted.boolean
TemplateAstMatcher. matches(Node n)
boolean
AstAnalyzer. mayHaveSideEffects(Node n)
Returns true if the node which may have side effects when executed.static boolean
ControlFlowAnalysis. mayThrowException(Node n)
Determines if the subtree might throw an exception.static Node
NodeUtil. newDeclaration(Node lhs, Node rhs, Token declarationType)
static Node
NodeUtil. newPropertyAccess(AbstractCompiler compiler, Node context, java.lang.String name)
Creates a property access on thecontext
tree.static Node
NodeUtil. newQNameDeclaration(AbstractCompiler compiler, java.lang.String name, Node value, JSDocInfo info)
Creates a node representing a qualified name.static Node
NodeUtil. newQNameDeclaration(AbstractCompiler compiler, java.lang.String name, Node value, JSDocInfo info, Token type)
Creates a node representing a qualified name.static Node
NodeUtil. newUndefinedNode(Node srcReferenceNode)
Create a node for an empty result expression: "void 0"static java.lang.Iterable<Node>
NodeUtil. preOrderIterable(Node root)
Same asNodeUtil.preOrderIterable(Node, Predicate)
but iterates over all nodes in the tree without exception.static java.lang.Iterable<Node>
NodeUtil. preOrderIterable(Node root, com.google.common.base.Predicate<Node> travserseNodePredicate)
Create anIterable
over the given node and all descendents.void
AstValidator. process(Node externs, Node root)
void
CheckConformance. process(Node externs, Node root)
void
CheckMissingOverrideTypes. process(Node externs, Node root)
void
CheckMissingRequires. process(Node externs, Node root)
void
CheckTypeImportCodeReferences. process(Node externs, Node root)
void
ChromePass. process(Node externs, Node root)
void
ClosureCheckModule. process(Node externs, Node root)
void
CompilerPass. process(Node externs, Node root)
Process the JS with root node root.void
ConcretizeStaticInheritanceForInlining. process(Node externs, Node root)
void
ControlFlowAnalysis. process(Node externs, Node root)
void
CrossChunkMethodMotion. process(Node externRoot, Node root)
void
CrossChunkReferenceCollector. process(Node root)
void
CrossChunkReferenceCollector. process(Node externs, Node root)
Convenience method for running this pass over a tree with this class as a callback.void
DeadPropertyAssignmentElimination. process(Node externs, Node root)
void
Es6CheckModule. process(Node externs, Node root)
void
Es6ConvertSuper. process(Node externs, Node root)
void
Es6ExtractClasses. process(Node externs, Node root)
void
Es6ForOfConverter. process(Node externs, Node root)
void
Es6NormalizeShorthandProperties. process(Node externs, Node root)
void
Es6RelativizeImportPaths. process(Node externs, Node root)
void
Es6RenameVariablesInParamLists. process(Node externs, Node root)
void
Es6RewriteArrowFunction. process(Node externs, Node root)
void
Es6RewriteBlockScopedDeclaration. process(Node externs, Node root)
void
Es6RewriteBlockScopedFunctionDeclaration. process(Node externs, Node root)
void
Es6RewriteClass. process(Node externs, Node root)
void
Es6RewriteClassExtendsExpressions. process(Node externs, Node root)
void
Es6RewriteDestructuring. process(Node externs, Node root)
void
Es6RewriteModules. process(Node externs, Node root)
void
Es6RewriteModulesToCommonJsModules. process(Node externs, Node root)
void
Es6RewriteRestAndSpread. process(Node externs, Node root)
void
Es6RewriteScriptsToModules. process(Node externs, Node root)
void
Es6SplitVariableDeclarations. process(Node externs, Node root)
void
Es7RewriteExponentialOperator. process(Node externs, Node root)
void
ExportTestFunctions. process(Node externs, Node root)
void
FindModuleDependencies. process(Node root)
void
ForbidDynamicImportUsage. process(Node externs, Node root)
void
GatherGetterAndSetterProperties. process(Node externs, Node root)
void
GatherModuleMetadata. process(Node externs, Node root)
void
GenerateExports. process(Node externs, Node root)
void
ImplicitNullabilityCheck. process(Node externs, Node root)
void
InjectTranspilationRuntimeLibraries. process(Node externs, Node root)
void
J2clAssertRemovalPass. process(Node externs, Node root)
void
J2clChecksPass. process(Node externs, Node root)
void
J2clClinitPrunerPass. process(Node externs, Node root)
void
J2clConstantHoisterPass. process(Node externs, Node root)
void
J2clPass. process(Node externs, Node root)
void
J2clPropertyInlinerPass. process(Node externs, Node root)
void
J2clUtilGetDefineRewriterPass. process(Node externs, Node root)
void
JsMessageVisitor. process(Node externs, Node root)
void
LateEs6ToEs3Converter. process(Node externs, Node root)
void
MarkUntranspilableFeaturesAsRemoved. process(Node externs, Node root)
void
ProcessCommonJSModules. process(Node externs, Node root)
void
ReferenceCollector. process(Node root)
void
ReferenceCollector. process(Node externs, Node root)
Convenience method for running this pass over a tree with this class as a callback.void
RemoveCastNodes. process(Node externs, Node root)
void
RewriteAsyncFunctions. process(Node externs, Node root)
void
RewriteAsyncIteration. process(Node externs, Node root)
void
RewriteClassFields. process(Node externs, Node root)
void
RewriteDynamicImports. process(Node externs, Node root)
void
RewriteGoogJsImports. process(Node externs, Node root)
void
RewriteJsonToModule. process(Node externs, Node root)
Module rewriting is done a on per-file basis prior to main compilation.void
RewriteLogicalAssignmentOperatorsPass. process(Node externs, Node root)
void
RewriteNullishCoalesceOperator. process(Node externs, Node root)
void
RewriteObjectSpread. process(Node externs, Node root)
void
RewritePolyfills. process(Node externs, Node root)
void
SyncCompilerFeatures. process(Node externs, Node root)
void
TransformAMDToCJSModule. process(Node externs, Node root)
void
TypeCheck. process(Node externsRoot, Node jsRoot)
Main entry point for this phase of processing.void
WhitespaceWrapGoogModules. process(Node externs, Node root)
TypedScope
TypeCheck. processForTesting(Node externsRoot, Node jsRoot)
Main entry point of this phase for testing code.static void
NodeUtil. removeChild(Node parent, Node node)
Safely remove children while maintaining a valid node structure.static void
NodeUtil. removeName(Node n)
Set the given function/class node to an empty namestatic void
NodeUtil. replaceDeclarationChild(Node declChild, Node newStatement)
Replace the child of a var/let/const declaration (usually a name) with a new statement.protected void
ConformanceRules.AbstractRule. report(Node n, ConformanceRules.ConformanceResult result)
Report a conformance warning for the given node.void
NodeTraversal. report(Node n, DiagnosticType diagnosticType, java.lang.String... arguments)
Reports a diagnostic (error or warning)abstract void
AbstractCompiler. reportChangeToChangeScope(Node changeScopeRoot)
Mark modifications in a scope that is different than the Compiler.currentScope use this (eg, InlineVariables and many others)void
Compiler. reportChangeToChangeScope(Node changeScopeRoot)
abstract void
AbstractCompiler. reportChangeToEnclosingScope(Node n)
Passes that make modifications in a scope that is different than the Compiler.currentScope use this (eg, InlineVariables and many others)void
Compiler. reportChangeToEnclosingScope(Node n)
void
NodeTraversal. reportCodeChange(Node n)
void
Compiler. reportFunctionDeleted(Node n)
void
CheckMissingOverrideTypes. reportMissingOverrideTypes(Node node, JSDocInfo completeJSDocInfo)
Emits error for a function or property declaration node with the replacement (complete) JSDoc.boolean
CheckConformance.Precondition. shouldCheck(Node n)
boolean
CheckConformance. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
CheckMissingRequires. shouldTraverse(NodeTraversal t, Node n, ModuleMetadataMap.ModuleMetadata currentModule, Node scopeRoot)
boolean
ControlFlowAnalysis. shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
boolean
ControlFlowGraph.AbstractCfgNodeTraversalCallback. shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
boolean
CrossChunkReferenceCollector. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
Es6ConvertSuperConstructorCalls. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
Es6RenameVariablesInParamLists. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
Es6RewriteArrowFunction. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
Es6RewriteClass. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
Es6RewriteDestructuring. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
Es6RewriteModules. shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
boolean
Es6RewriteScriptsToModules. shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
boolean
Es7RewriteExponentialOperator. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
FindModuleDependencies. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
ForbidDynamicImportUsage. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
LateEs6ToEs3Converter. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
NodeTraversal.AbstractChangedScopeCallback. shouldTraverse(NodeTraversal t, Node n, Node parent)
protected boolean
NodeTraversal.AbstractModuleCallback. shouldTraverse(NodeTraversal t, Node n, ModuleMetadataMap.ModuleMetadata currentModule, Node moduleScopeRoot)
boolean
NodeTraversal.AbstractModuleCallback. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
NodeTraversal.AbstractPostOrderCallback. shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
boolean
NodeTraversal.AbstractScopedCallback. shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
boolean
NodeTraversal.AbstractShallowCallback. shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
boolean
NodeTraversal.AbstractShallowStatementCallback. shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
boolean
NodeTraversal.Callback. shouldTraverse(NodeTraversal t, Node n, Node parent)
Visits a node in preorder (before its children) and decides whether its children should be traversed.boolean
NodeTraversal.ExternsSkippingCallback. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
ProcessCommonJSModules. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
RewriteAsyncFunctions. shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
boolean
RewriteAsyncIteration. shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
boolean
RewriteClassFields. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
RewriteLogicalAssignmentOperatorsPass. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
RewriteNullishCoalesceOperator. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
RewriteObjectSpread. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
TypeCheck. shouldTraverse(NodeTraversal t, Node n, Node parent)
void
Es6SplitVariableDeclarations. splitDeclaration(NodeTraversal t, Node n, Node parent)
static java.lang.String
DotFormatter. toDot(Node n)
Converts an AST to dot representation.abstract java.lang.String
AbstractCompiler. toSource(Node root)
Prints a node to source code.void
Compiler. toSource(Compiler.CodeBuilder cb, int inputSeqNum, Node root)
Writes out JS code from a root node.java.lang.String
Compiler. toSource(Node n)
Generates JavaScript source code for an AST, doesn't generate source map info.void
NodeTraversal.Builder. traverse(Node root)
static void
NodeTraversal. traverse(AbstractCompiler compiler, Node root, NodeTraversal.Callback cb)
Traverses using the SyntacticScopeCreatorstatic void
NodeTraversal. traverseRoots(AbstractCompiler compiler, NodeTraversal.Callback cb, Node externs, Node root)
static void
NodeTraversal. traverseScopeRoots(AbstractCompiler compiler, Node root, java.util.List<Node> scopeNodes, NodeTraversal.Callback cb, boolean traverseNested)
Traverses *just* the contents of provided scope nodes (and optionally scopes nested within them) but will fall back on traversing the entire AST from root if a null scope nodes list is provided.static boolean
NodeUtil. tryMergeBlock(Node block, boolean ignoreBlockScopedDeclarations)
Merge a block with its parent block.static void
GatherGetterAndSetterProperties. update(AbstractCompiler compiler, Node externs, Node root)
Gathers all getters and setters in the AST.void
AstValidator. validateCodeRoot(Node n)
void
AstValidator. validateExpression(Node n)
void
AstValidator. validateModuleContents(Node n)
void
AstValidator. validateRoot(Node n)
void
AstValidator. validateScript(Node n)
void
AstValidator. validateStatement(Node n)
void
AstValidator. validateStatement(Node n, boolean isAmbient)
Validates a statement node and its children.void
AstValidator. validateStatements(Node n)
void
CheckConformance. visit(NodeTraversal t, Node n, Node parent)
void
CheckMissingOverrideTypes. visit(NodeTraversal t, Node n, Node parent)
void
CheckMissingRequires. visit(NodeTraversal t, Node n, ModuleMetadataMap.ModuleMetadata currentModule, Node scopeRoot)
void
CheckTypeImportCodeReferences. visit(NodeTraversal t, Node n, Node parent)
void
ChromePass. visit(NodeTraversal t, Node node, Node parent)
protected void
ClosureCheckModule. visit(NodeTraversal t, Node n, ModuleMetadataMap.ModuleMetadata currentModule, Node moduleScopeRoot)
void
ControlFlowAnalysis. visit(NodeTraversal t, Node n, Node parent)
void
CrossChunkReferenceCollector. visit(NodeTraversal t, Node n, Node parent)
For each node, update the block stack and reference collection as appropriate.void
Es6CheckModule. visit(NodeTraversal t, Node n, Node parent)
void
Es6ConvertSuper. visit(NodeTraversal t, Node n, Node parent)
void
Es6ConvertSuperConstructorCalls. visit(NodeTraversal t, Node n, Node parent)
void
Es6ExtractClasses. visit(NodeTraversal t, Node n, Node parent)
void
Es6ForOfConverter. visit(NodeTraversal t, Node n, Node parent)
void
Es6NormalizeShorthandProperties. visit(NodeTraversal t, Node n, Node parent)
void
Es6RenameVariablesInParamLists. visit(NodeTraversal t, Node block, Node function)
void
Es6RewriteArrowFunction. visit(NodeTraversal t, Node n, Node parent)
void
Es6RewriteBlockScopedDeclaration. visit(NodeTraversal t, Node n, Node parent)
void
Es6RewriteBlockScopedFunctionDeclaration. visit(NodeTraversal t, Node n, Node parent)
void
Es6RewriteClass. visit(NodeTraversal t, Node n, Node parent)
void
Es6RewriteClassExtendsExpressions. visit(NodeTraversal t, Node n, Node parent)
void
Es6RewriteDestructuring. visit(NodeTraversal t, Node n, Node parent)
void
Es6RewriteModules. visit(NodeTraversal t, Node n, Node parent)
void
Es6RewriteRestAndSpread. visit(NodeTraversal traversal, Node current, Node parent)
void
Es6SplitVariableDeclarations. visit(NodeTraversal t, Node n, Node parent)
void
Es7RewriteExponentialOperator. visit(NodeTraversal t, Node n, Node parent)
void
FindModuleDependencies. visit(NodeTraversal t, Node n, Node parent)
void
ForbidDynamicImportUsage. visit(NodeTraversal t, Node n, Node parent)
void
ImplicitNullabilityCheck. visit(NodeTraversal t, Node n, Node p)
Crawls the JSDoc of the given node to find any names in JSDoc that are implicitly null.void
InjectTranspilationRuntimeLibraries. visit(NodeTraversal t, Node n, Node parent)
void
J2clAssertRemovalPass. visit(NodeTraversal t, Node node, Node parent)
void
J2clChecksPass. visit(NodeTraversal unused, Node n, Node parent)
void
J2clUtilGetDefineRewriterPass. visit(NodeTraversal t, Node n, Node parent)
void
JsMessageVisitor. visit(NodeTraversal traversal, Node node, Node unused)
void
LateEs6ToEs3Converter. visit(NodeTraversal t, Node n, Node parent)
void
MarkUntranspilableFeaturesAsRemoved. visit(NodeTraversal t, Node n, Node parent)
protected void
NodeTraversal.AbstractModuleCallback. visit(NodeTraversal t, Node n, ModuleMetadataMap.ModuleMetadata currentModule, Node moduleScopeRoot)
void
NodeTraversal.AbstractModuleCallback. visit(NodeTraversal t, Node n, Node parent)
void
NodeTraversal.AbstractPostOrderCallbackInterface. visit(NodeTraversal t, Node n, Node parent)
void
NodeTraversal.AbstractPreOrderCallback. visit(NodeTraversal t, Node n, Node parent)
void
NodeTraversal.Callback. visit(NodeTraversal t, Node n, Node parent)
Visits a node in postorder (after its children).void
NodeUtil.Visitor. visit(Node node)
void
RewriteAsyncFunctions. visit(NodeTraversal t, Node n, Node parent)
void
RewriteAsyncIteration. visit(NodeTraversal t, Node n, Node parent)
void
RewriteClassFields. visit(NodeTraversal t, Node n, Node parent)
void
RewriteDynamicImports. visit(NodeTraversal t, Node n, Node parent)
void
RewriteJsonToModule. visit(NodeTraversal t, Node n, Node parent)
void
RewriteLogicalAssignmentOperatorsPass. visit(NodeTraversal t, Node logicalAssignment, Node parent)
void
RewriteNullishCoalesceOperator. visit(NodeTraversal t, Node n, Node parent)
void
RewriteObjectSpread. visit(NodeTraversal t, Node n, Node parent)
void
SourceInformationAnnotator. visit(NodeTraversal t, Node n, Node parent)
void
TypeCheck. visit(NodeTraversal t, Node n, Node parent)
This is the meat of the type checking.static void
NodeUtil. visitPostOrder(Node node, NodeUtil.Visitor visitor)
A post-order traversal, calling Visitor.visit for each decendent.static void
NodeUtil. visitPostOrder(Node node, NodeUtil.Visitor visitor, com.google.common.base.Predicate<Node> traverseChildrenPred)
A post-order traversal, calling Visitor.visit for each node in the tree.static void
NodeUtil. visitPreOrder(Node node, NodeUtil.Visitor visitor)
A pre-order traversal, calling Visitor.visit for each decendent.static void
NodeUtil. visitPreOrder(Node node, NodeUtil.Visitor visitor, com.google.common.base.Predicate<Node> traverseChildrenPred)
A pre-order traversal, calling Visitor.visit for each node in the tree.Method parameters in com.google.javascript.jscomp with type arguments of type Node Modifier and Type Method Description static Node
NodeUtil. findPreorder(Node node, com.google.common.base.Predicate<Node> pred, com.google.common.base.Predicate<Node> traverseChildrenPred)
Returns the first Node matching the given pred via a pre-order traversal.static int
NodeUtil. getCount(Node n, com.google.common.base.Predicate<Node> pred, com.google.common.base.Predicate<Node> traverseChildrenPred)
static Node
NodeUtil. getEnclosingNode(Node n, com.google.common.base.Predicate<Node> pred)
static void
NodeUtil. getParamOrPatternNames(Node n, java.util.function.Consumer<Node> cb)
Callscb
with all NAMEs declared in a PARAM_LIST or destructuring pattern.static java.util.List<Node>
NodeUtil. getParentChangeScopeNodes(java.util.List<Node> scopeNodes)
Returns the list of scope nodes which are parents of the provided list of scope nodes.static boolean
NodeUtil. has(Node node, com.google.common.base.Predicate<Node> pred, com.google.common.base.Predicate<Node> traverseChildrenPred)
static java.lang.Iterable<Node>
NodeUtil. preOrderIterable(Node root, com.google.common.base.Predicate<Node> travserseNodePredicate)
Create anIterable
over the given node and all descendents.static java.util.List<Node>
NodeUtil. removeNestedChangeScopeNodes(java.util.List<Node> scopeNodes)
Removes any scope nodes from the provided list that are nested within some other scope node also in the list.static void
NodeTraversal. traverseScopeRoots(AbstractCompiler compiler, Node root, java.util.List<Node> scopeNodes, NodeTraversal.Callback cb, boolean traverseNested)
Traverses *just* the contents of provided scope nodes (and optionally scopes nested within them) but will fall back on traversing the entire AST from root if a null scope nodes list is provided.static void
NodeUtil. visitPostOrder(Node node, NodeUtil.Visitor visitor, com.google.common.base.Predicate<Node> traverseChildrenPred)
A post-order traversal, calling Visitor.visit for each node in the tree.static void
NodeUtil. visitPreOrder(Node node, NodeUtil.Visitor visitor, com.google.common.base.Predicate<Node> traverseChildrenPred)
A pre-order traversal, calling Visitor.visit for each node in the tree.Constructors in com.google.javascript.jscomp with parameters of type Node Constructor Description Bind(Node target, Node thisValue, Node parameters)
Builder(Node node)
Sets the root node from which to generate the source code.Cache(Node cacheObj, Node key, Node valueFn, Node keyFn)
SubclassRelationship(CodingConvention.SubclassType type, Node subclassNode, Node superclassNode)
TemplateAstMatcher(AbstractCompiler compiler, Node templateFunctionNode, TypeMatchingStrategy typeMatchingStrategy)
Constructs this matcher with a Function node that serves as the template to match all other nodes against. -
Uses of Node in com.google.javascript.jscomp.disambiguate
Methods in com.google.javascript.jscomp.disambiguate with parameters of type Node Modifier and Type Method Description void
AmbiguateProperties. process(Node externs, Node root)
void
DisambiguateProperties. process(Node externs, Node root)
-
Uses of Node in com.google.javascript.jscomp.ijs
Methods in com.google.javascript.jscomp.ijs with parameters of type Node Modifier and Type Method Description void
ConvertToTypedInterface. process(Node externs, Node root)
-
Uses of Node in com.google.javascript.jscomp.instrumentation
Methods in com.google.javascript.jscomp.instrumentation with parameters of type Node Modifier and Type Method Description void
CoverageInstrumentationPass. process(Node externsNode, Node rootNode)
void
BranchCoverageInstrumentationCallback. visit(NodeTraversal traversal, Node node, Node parent)
-
Uses of Node in com.google.javascript.jscomp.lint
Methods in com.google.javascript.jscomp.lint that return Node Modifier and Type Method Description Node
CheckProvidesSorted. getFirstNode()
Returns the node for the first recognized provide statement.Node
CheckRequiresSorted. getFirstNode()
Returns the node for the first recognized import statement.Node
CheckProvidesSorted. getLastNode()
Returns the node for the last recognized provide statement.Node
CheckRequiresSorted. getLastNode()
Returns the node for the last recognized import statement.Methods in com.google.javascript.jscomp.lint with parameters of type Node Modifier and Type Method Description boolean
CheckArrayWithGoogObject. isGoogObjectIterationOverArray(Node n)
void
CheckArrayWithGoogObject. process(Node externs, Node root)
void
CheckConstantCaseNames. process(Node externs, Node root)
void
CheckConstPrivateProperties. process(Node externs, Node root)
void
CheckDefaultExportOfGoogModule. process(Node externs, Node root)
void
CheckDuplicateCase. process(Node externs, Node root)
void
CheckEmptyStatements. process(Node externs, Node root)
void
CheckEnums. process(Node externs, Node root)
void
CheckEs6ModuleFileStructure. process(Node externs, Node root)
void
CheckEs6Modules. process(Node externs, Node root)
void
CheckExtraRequires. process(Node externs, Node root)
void
CheckGoogModuleTypeScriptName. process(Node externs, Node root)
void
CheckInterfaces. process(Node externs, Node root)
void
CheckJSDocStyle. process(Node externs, Node root)
void
CheckMissingSemicolon. process(Node externs, Node root)
void
CheckNestedNames. process(Node externs, Node root)
void
CheckNoMutatedEs6Exports. process(Node externs, Node root)
void
CheckNullabilityModifiers. process(Node externs, Node root)
void
CheckPrimitiveAsObject. process(Node externs, Node root)
void
CheckPrototypeProperties. process(Node externs, Node root)
void
CheckUnusedLabels. process(Node externs, Node root)
void
CheckUnusedPrivateProperties. process(Node externs, Node root)
void
CheckUselessBlocks. process(Node externs, Node root)
void
CheckVar. process(Node externs, Node root)
boolean
CheckConstantCaseNames. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
CheckDefaultExportOfGoogModule. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
CheckEs6ModuleFileStructure. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
CheckEs6Modules. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
CheckGoogModuleTypeScriptName. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
CheckNestedNames. shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
boolean
CheckNoMutatedEs6Exports. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
CheckPrototypeProperties. shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent)
boolean
CheckProvidesSorted. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
CheckRequiresSorted. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
CheckUnusedLabels. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
CheckUnusedPrivateProperties. shouldTraverse(NodeTraversal t, Node n, Node parent)
boolean
CheckUselessBlocks. shouldTraverse(NodeTraversal t, Node n, Node parent)
void
CheckArrayWithGoogObject. visit(NodeTraversal unused, Node n, Node parent)
void
CheckConstantCaseNames. visit(NodeTraversal t, Node n, Node parent)
void
CheckConstPrivateProperties. visit(NodeTraversal t, Node n, Node parent)
void
CheckDefaultExportOfGoogModule. visit(NodeTraversal t, Node n, Node parent)
void
CheckDuplicateCase. visit(NodeTraversal t, Node n, Node parent)
void
CheckEmptyStatements. visit(NodeTraversal t, Node n, Node parent)
void
CheckEnums. visit(NodeTraversal t, Node n, Node parent)
void
CheckEs6Modules. visit(NodeTraversal t, Node n, Node parent)
void
CheckExtraRequires. visit(NodeTraversal t, Node n, Node parent)
void
CheckGoogModuleTypeScriptName. visit(NodeTraversal t, Node n, Node parent)
void
CheckInterfaces. visit(NodeTraversal t, Node n, Node parent)
void
CheckJSDocStyle. visit(NodeTraversal t, Node n, Node unused)
void
CheckMissingSemicolon. visit(NodeTraversal t, Node n, Node parent)
void
CheckNestedNames. visit(NodeTraversal t, Node n, Node parent)
void
CheckNoMutatedEs6Exports. visit(NodeTraversal t, Node n, Node parent)
void
CheckNullabilityModifiers. visit(NodeTraversal t, Node n, Node parent)
void
CheckPrimitiveAsObject. visit(NodeTraversal t, Node n, Node parent)
void
CheckPrototypeProperties. visit(NodeTraversal unused, Node n, Node parent)
void
CheckProvidesSorted. visit(NodeTraversal t, Node n, Node parent)
void
CheckRequiresSorted. visit(NodeTraversal t, Node n, Node parent)
void
CheckUnusedLabels. visit(NodeTraversal t, Node n, Node parent)
void
CheckUnusedPrivateProperties. visit(NodeTraversal t, Node n, Node parent)
void
CheckUselessBlocks. visit(NodeTraversal t, Node n, Node parent)
void
CheckVar. visit(NodeTraversal t, Node n, Node parent)
-
Uses of Node in com.google.javascript.jscomp.modules
Methods in com.google.javascript.jscomp.modules that return Node Modifier and Type Method Description abstract Node
Export. exportNode()
Node that this export originates from.abstract Node
Import. importNode()
Returns the import node for source information.abstract Node
Export. nameNode()
Node that this export originates from.abstract Node
Import. nameNode()
Returns the name node for source information.abstract Node
ModuleMetadataMap.ModuleMetadata. rootNode()
AST node that represents the root of this module.abstract Node
Binding. sourceNode()
The AST node to use for source location when rewriting.Methods in com.google.javascript.jscomp.modules with parameters of type Node Modifier and Type Method Description com.google.javascript.jscomp.modules.UnresolvedModule
EsModuleProcessor. process(ModuleMetadataMap.ModuleMetadata metadata, ModuleLoader.ModulePath path, Node script)
void
ModuleMapCreator. process(Node externs, Node root)
abstract ModuleMetadataMap.ModuleMetadata.Builder
ModuleMetadataMap.ModuleMetadata.Builder. rootNode(Node root)
boolean
EsModuleProcessor. shouldTraverse(NodeTraversal t, Node n, Node parent)
void
EsModuleProcessor. visit(NodeTraversal t, Node n, Node parent)
-
Uses of Node in com.google.javascript.jscomp.parsing
Fields in com.google.javascript.jscomp.parsing declared as Node Modifier and Type Field Description Node
ParserRunner.ParseResult. ast
Methods in com.google.javascript.jscomp.parsing that return Node Modifier and Type Method Description Node
TypeTransformationParser. getTypeTransformationAst()
static Node
JsDocInfoParser. parseTypeString(java.lang.String typeString)
Parses a string containing a JsDoc type declaration, returning the type if the parsing succeeded ornull
if it failed.Methods in com.google.javascript.jscomp.parsing with parameters of type Node Modifier and Type Method Description static void
ParsingUtil. getParamOrPatternNames(Node n, java.util.function.Consumer<Node> cb)
Callscb
with all NAMEs declared in a PARAM_LIST or destructuring pattern.Method parameters in com.google.javascript.jscomp.parsing with type arguments of type Node Modifier and Type Method Description static void
ParsingUtil. getParamOrPatternNames(Node n, java.util.function.Consumer<Node> cb)
Callscb
with all NAMEs declared in a PARAM_LIST or destructuring pattern.Constructors in com.google.javascript.jscomp.parsing with parameters of type Node Constructor Description JsDocInfoParser(JsDocTokenStream stream, java.lang.String comment, int commentPosition, Node templateNode, Config config, ErrorReporter errorReporter)
ParseResult(Node ast, java.util.List<Comment> comments, FeatureSet features, java.lang.String sourceMapURL)
-
Uses of Node in com.google.javascript.jscomp.serialization
Methods in com.google.javascript.jscomp.serialization that return types with arguments of type Node Modifier and Type Method Description abstract com.google.common.collect.ImmutableMap<SourceFile,java.util.function.Supplier<Node>>
TypedAstDeserializer.DeserializedAst. getFilesystem()
Maps from SourceFile to a lazy deserializer of the SCRIPT node for that fileMethods in com.google.javascript.jscomp.serialization with parameters of type Node Modifier and Type Method Description void
ConvertTypesToColors. process(Node externs, Node root)
void
SerializeTypedAstPass. process(Node externs, Node root)
-
Uses of Node in com.google.javascript.jscomp.type
Methods in com.google.javascript.jscomp.type with parameters of type Node Modifier and Type Method Description protected FlowScope
ChainableReverseAbstractInterpreter. declareNameInScope(FlowScope scope, Node node, JSType type)
Declares a refined type inscope
for the name represented bynode
.protected FlowScope
ChainableReverseAbstractInterpreter. firstPreciserScopeKnowingConditionOutcome(Node condition, FlowScope blindScope, Outcome outcome)
Calculates the preciser scope starting with the first link.FlowScope
ClosureReverseAbstractInterpreter. getPreciserScopeKnowingConditionOutcome(Node condition, FlowScope blindScope, Outcome outcome)
FlowScope
ReverseAbstractInterpreter. getPreciserScopeKnowingConditionOutcome(Node condition, FlowScope blindScope, Outcome outcome)
Calculates a precise version of the scope knowing the outcome of the condition.FlowScope
SemanticReverseAbstractInterpreter. getPreciserScopeKnowingConditionOutcome(Node condition, FlowScope blindScope, Outcome outcome)
protected JSType
ChainableReverseAbstractInterpreter. getTypeIfRefinable(Node node, FlowScope scope)
Returns the type of a node in the given scope if the node corresponds to a name whose type is capable of being refined.FlowScope
FlowScope. inferQualifiedSlot(Node node, java.lang.String symbol, JSType bottomType, JSType inferredType, boolean declare)
Returns a flow scope with the type of the givensymbol
updated toinferredType
.protected FlowScope
ChainableReverseAbstractInterpreter. nextPreciserScopeKnowingConditionOutcome(Node condition, FlowScope blindScope, Outcome outcome)
Delegates the calculation of the preciser scope to the next link. -
Uses of Node in com.google.javascript.refactoring
Methods in com.google.javascript.refactoring that return Node Modifier and Type Method Description Node
Match. getNode()
Returns the node that matched the given conditions.Methods in com.google.javascript.refactoring that return types with arguments of type Node Modifier and Type Method Description java.util.Map<java.lang.String,Node>
JsSourceMatcher. getTemplateNodeToMatchMap()
Returns a map from named template node strings to Nodes that were the equivalent matches from the last matched template.Methods in com.google.javascript.refactoring with parameters of type Node Modifier and Type Method Description SuggestedFix.Builder
SuggestedFix.Builder. addCast(Node n, AbstractCompiler compiler, java.lang.String type)
Adds a cast of the given type to the provided node.SuggestedFix.Builder
SuggestedFix.Builder. addChildToFront(Node parentNode, java.lang.String content)
Inserts a new node as the first child of the provided node.SuggestedFix.Builder
SuggestedFix.Builder. addOrReplaceJsDoc(Node n, java.lang.String newJsDoc)
Adds or replaces the JS Doc for the given node.SuggestedFix.Builder
SuggestedFix.Builder. attachMatchedNodeInfo(Node node, AbstractCompiler compiler)
Sets the node on this SuggestedFix that caused this SuggestedFix to be built in the first place.SuggestedFix.Builder
SuggestedFix.Builder. changeJsDocType(Node n, AbstractCompiler compiler, java.lang.String type)
Changes the JS Doc Type of the given node.static ScriptMetadata
ScriptMetadata. create(Node script, AbstractCompiler compiler)
SuggestedFix.Builder
SuggestedFix.Builder. delete(Node n)
Deletes a node and its contents from the source file.SuggestedFix.Builder
SuggestedFix.Builder. deleteArgument(Node n, int position)
Deletes an argument from an existing function call, including any JS doc that precedes it.SuggestedFix.Builder
SuggestedFix.Builder. deleteWithoutRemovingWhitespace(Node n)
Deletes a node without touching any surrounding whitespace.SuggestedFix.Builder
SuggestedFix.Builder. deleteWithoutRemovingWhitespaceBefore(Node n)
Deletes a node and its contents from the source file.java.lang.String
SuggestedFix.Builder. generateCode(AbstractCompiler compiler, Node node)
SuggestedFix.Builder
SuggestedFix.Builder. insertAfter(Node node, java.lang.String text)
Inserts the text after the given nodeSuggestedFix.Builder
SuggestedFix.Builder. insertArguments(Node n, int position, java.lang.String... args)
Inserts arguments into an existing function call.SuggestedFix.Builder
SuggestedFix.Builder. insertBefore(Node nodeToInsertBefore, Node n, AbstractCompiler compiler)
Inserts a new node before the provided node.SuggestedFix.Builder
SuggestedFix.Builder. insertBefore(Node nodeToInsertBefore, java.lang.String content)
Inserts a string before the provided node.static boolean
RefactoringUtils. isInClosurizedFile(Node node, NodeMetadata metadata)
Looks for a goog.require(), goog.provide() or goog.module() call in the node's file.boolean
JsSourceMatcher. matches(Node n, NodeMetadata metadata)
boolean
Matcher. matches(Node n, NodeMetadata metadata)
Returns true if the specifiedNode
andNodeMetadata
match the given pattern.abstract boolean
Scanner. matches(Node node, NodeMetadata t)
Returns true if the given node and node traversal should match for this particular scanner.SuggestedFix.Builder
SuggestedFix.Builder. removeCast(Node n, AbstractCompiler compiler)
Removes a cast from the given node.SuggestedFix.Builder
SuggestedFix.Builder. rename(Node n, java.lang.String name)
Renames a given node to the provided name.SuggestedFix.Builder
SuggestedFix.Builder. rename(Node n, java.lang.String name, boolean replaceNameSubtree)
Renames a given node to the provided name.SuggestedFix.Builder
SuggestedFix.Builder. replace(Node original, Node newNode, AbstractCompiler compiler)
Replaces the provided node with new node in the source file.SuggestedFix.Builder
SuggestedFix.Builder. replaceRange(Node first, Node last, java.lang.String newContent)
Replaces a range of nodes with the given content.Constructors in com.google.javascript.refactoring with parameters of type Node Constructor Description JsSourceMatcher(AbstractCompiler compiler, Node templateNode, TypeMatchingStrategy typeMatchingStrategy)
Constructs this matcher with a Function node that serves as the template to match all other nodes against.Match(Node node, NodeMetadata metadata)
-
Uses of Node in com.google.javascript.refactoring.examples
Methods in com.google.javascript.refactoring.examples with parameters of type Node Modifier and Type Method Description boolean
GoogBindToArrow. matches(Node node, NodeMetadata metadata)
-
Uses of Node in com.google.javascript.rhino
Methods in com.google.javascript.rhino that return Node Modifier and Type Method Description static Node
IR. add(Node expr1, Node expr2)
static Node
IR. and(Node expr1, Node expr2)
static Node
TypeDeclarationsIR. anyType()
Equivalent to the UNKNOWN type in Closure, expressed with{?}
static Node
IR. arraylit(Node... exprs)
static Node
IR. arraylit(java.lang.Iterable<Node> exprs)
static Node
IR. arrayPattern(Node... keys)
static Node
TypeDeclarationsIR. arrayType(Node elementType)
Represents an array type.static Node
IR. arrowFunction(Node name, Node params, Node body)
static Node
IR. assign(Node target, Node expr)
static Node
IR. assignAnd(Node expr1, Node expr2)
"&&="static Node
IR. assignCoalesce(Node expr1, Node expr2)
"??="static Node
IR. assignOr(Node expr1, Node expr2)
"||="static Node
IR. await(Node expr)
static Node
IR. bigint(java.math.BigInteger b)
static Node
IR. block()
static Node
IR. block(Node stmt)
static Node
IR. block(Node... stmts)
static Node
IR. block(java.util.List<Node> stmts)
static Node
TypeDeclarationsIR. booleanType()
static Node
IR. breakNode()
static Node
IR. breakNode(Node name)
static Node
IR. call(Node target, Node... args)
static Node
IR. caseNode(Node expr, Node body)
static Node
IR. cast(Node expr1, JSDocInfo jsdoc)
static Node
IR. catchNode(Node expr, Node body)
Node
Node. cloneNode()
Node
Node. clonePropsFrom(Node other)
Clone the properties from the provided node without copying the property object.Node
Node. cloneTree()
Node
Node. cloneTree(boolean cloneTypeExprs)
static Node
IR. coalesce(Node expr1, Node expr2)
static Node
IR. comma(Node expr1, Node expr2)
static Node
IR. computedProp(Node key, Node value)
static Node
IR. constNode(Node lhs, Node value)
static Node
IR. continueNode()
static Node
IR. continueNode(Node name)
static Node
IR. continueOptChainCall(Node target, Node... args)
static Node
IR. continueOptChainGetelem(Node target, Node elem)
static Node
IR. continueOptChainGetprop(Node target, java.lang.String prop)
Node
Node. copyTypeFrom(Node other)
Copies a nodes JSType or Color (if present)static Node
IR. dec(Node exp, boolean isPost)
static Node
IR. declaration(Node lhs, Node value, Token type)
static Node
IR. declaration(Node lhs, Token type)
static Node
IR. defaultCase(Node body)
static Node
IR. delprop(Node target)
Node
Node. detach()
Removes this node from its parent, but retains its subtree.static Node
IR. doNode(Node body, Node cond)
static Node
IR. empty()
static Node
IR. eq(Node expr1, Node expr2)
"=="static Node
IR. export(Node declaration)
static Node
IR. exprResult(Node expr)
static Node
IR. falseNode()
static Node
IR. forIn(Node target, Node cond, Node body)
static Node
IR. forNode(Node init, Node cond, Node incr, Node body)
static Node
IR. function(Node name, Node params, Node body)
static Node
TypeDeclarationsIR. functionType(Node returnType, java.util.LinkedHashMap<java.lang.String,Node> requiredParams, java.util.LinkedHashMap<java.lang.String,Node> optionalParams, java.lang.String restName, Node restType)
Represents a function type.static Node
IR. ge(Node expr1, Node expr2)
">="Node
Node. getAncestor(int level)
Gets the ancestor node relative to this.Node
Node. getChildAtIndex(int i)
Gets the ith child, note that this is O(N) where N is the number of children.Node
Node. getDeclaredTypeExpression()
Returns the syntactical type specified on this node.static Node
IR. getelem(Node target, Node elem)
Node
Node. getFirstChild()
Node
Node. getFirstFirstChild()
Get the first child of the first child.Node
Node. getGrandparent()
Node
Node. getLastChild()
Node
Node. getNext()
Node
StaticRef. getNode()
The node where the reference lives.Node
Node. getOnlyChild()
Node
Node. getParent()
Node
Node. getPrevious()
static Node
IR. getprop(Node target, java.lang.String prop)
static Node
IR. getprop(Node target, java.lang.String prop, java.lang.String... moreProps)
Node
JSTypeExpression. getRoot()
Node
StaticScope. getRootNode()
Returns the root node associated with this scope.Node
Node. getSecondChild()
static Node
IR. getterDef(java.lang.String name, Node value)
static Node
IR. hook(Node cond, Node trueval, Node falseval)
static Node
IR. ifNode(Node cond, Node then)
static Node
IR. ifNode(Node cond, Node then, Node elseNode)
static Node
IR. importMeta()
static Node
IR. importNode(Node name, Node importSpecs, Node moduleIdentifier)
static Node
IR. importStar(java.lang.String name)
static Node
IR. in(Node expr1, Node expr2)
static Node
IR. inc(Node exp, boolean isPost)
static Node
IR. iterRest(Node target)
static Node
IR. iterSpread(Node expr)
static Node
IR. label(Node name, Node stmt)
static Node
IR. labelName(java.lang.String name)
static Node
IR. let(Node lhs)
static Node
IR. let(Node lhs, Node value)
static Node
IR. lt(Node expr1, Node expr2)
"<"static Node
IR. memberFieldDef(java.lang.String name, Node value)
static Node
IR. memberFunctionDef(java.lang.String name, Node function)
static Node
IR. name(java.lang.String name)
static Node
TypeDeclarationsIR. namedType(java.lang.Iterable<java.lang.String> segments)
Produces a tree structure similar to the Rhino AST of a qualified name expression, under a top-level NAMED_TYPE node.static Node
TypeDeclarationsIR. namedType(java.lang.String typeName)
Splits a '.' separated qualified name into a tree of type segments.static Node
IR. ne(Node expr1, Node expr2)
"!="static Node
IR. neg(Node expr1)
static Node
Node. newBigInt(java.math.BigInteger bigint)
static Node
IR. newNode(Node target, Node... args)
static Node
Node. newNumber(double number)
static Node
Node. newString(Token token, java.lang.String str)
static Node
Node. newString(java.lang.String str)
static Node
Node. newTemplateLitString(java.lang.String cooked, java.lang.String raw)
static Node
IR. not(Node expr1)
static Node
IR. nullNode()
static Node
IR. number(double d)
static Node
TypeDeclarationsIR. numberType()
static Node
IR. objectlit(Node... propdefs)
static Node
IR. objectPattern(Node... keys)
static Node
IR. objectRest(Node target)
static Node
IR. objectSpread(Node expr)
static Node
TypeDeclarationsIR. optionalParameter(Node parameterType)
Represents a function parameter that is optional.static Node
IR. or(Node expr1, Node expr2)
static Node
TypeDeclarationsIR. parameterizedType(Node baseType, java.lang.Iterable<Node> typeParameters)
Represents a parameterized, or generic, type.static Node
IR. paramList(Node... params)
static Node
IR. pos(Node expr1)
static Node
IR. propdef(Node string, Node value)
static Node
IR. quotedStringKey(java.lang.String s, Node value)
static Node
TypeDeclarationsIR. recordType(java.util.LinkedHashMap<java.lang.String,Node> properties)
Represents a structural type.static Node
IR. regexp(Node expr)
static Node
IR. regexp(Node expr, Node flags)
Node
Node. removeChildren()
Node
Node. removeFirstChild()
Removes the first child of Node.static Node
IR. returnNode()
static Node
IR. returnNode(Node expr)
static Node
IR. root(Node... rootChildren)
static Node
IR. script()
static Node
IR. script(Node... stmts)
static Node
IR. script(java.util.List<Node> stmts)
Node
Node. setColor(Color x)
Node
Node. setJSDocInfo(JSDocInfo info)
Sets theJSDocInfo
attached to this node.Node
Node. setJSType(JSType x)
Node
Node. setLinenoCharno(int lineno, int charno)
Merges the line number and character number in one integer.Node
Node. setNonJSDocComment(NonJSDocComment comment)
Sets the NonJSDoc comment attached to this node.Node
Node. setStaticSourceFile(StaticSourceFile file)
static Node
IR. setterDef(java.lang.String name, Node value)
static Node
IR. sheq(Node expr1, Node expr2)
"==="static Node
IR. shne(Node expr1, Node expr2)
"!=="Node
Node. srcref(Node other)
Copy the source info from `other` onto `this`.Node
Node. srcrefIfMissing(Node other)
Iff source info is not set on `this`, copy the source info from `other`.Node
Node. srcrefTree(Node other)
For all Nodes in the subtree of `this`, copy the source info from `other`.Node
Node. srcrefTreeIfMissing(Node other)
For all Nodes in the subtree of `this`, iff source info is not set, copy the source info from `other`.static Node
IR. startOptChainCall(Node target, Node... args)
static Node
IR. startOptChainGetelem(Node target, Node elem)
static Node
IR. startOptChainGetprop(Node target, java.lang.String prop)
static Node
IR. string(java.lang.String s)
static Node
IR. stringKey(java.lang.String s)
static Node
IR. stringKey(java.lang.String s, Node value)
static Node
TypeDeclarationsIR. stringType()
static Node
IR. sub(Node expr1, Node expr2)
static Node
IR. superNode()
static Node
IR. switchNode(Node cond, Node... cases)
static Node
IR. thisNode()
static Node
IR. throwNode(Node expr)
static Node
IR. trueNode()
static Node
IR. tryCatch(Node tryBody, Node catchNode)
static Node
IR. tryCatchFinally(Node tryBody, Node catchNode, Node finallyBody)
static Node
IR. tryFinally(Node tryBody, Node finallyBody)
static Node
IR. typeof(Node expr)
static Node
TypeDeclarationsIR. undefinedType()
static Node
TypeDeclarationsIR. unionType(Node... options)
static Node
TypeDeclarationsIR. unionType(java.lang.Iterable<Node> options)
Represents a union type, which can be one of the given types.static Node
IR. var(Node lhs)
static Node
IR. var(Node lhs, Node value)
static Node
IR. voidNode(Node expr1)
static Node
TypeDeclarationsIR. voidType()
static Node
IR. whileNode(Node cond, Node body)
static Node
IR. yield()
static Node
IR. yield(Node expr)
Methods in com.google.javascript.rhino that return types with arguments of type Node Modifier and Type Method Description java.lang.Iterable<Node>
Node. children()
Deprecated.com.google.common.collect.ImmutableList<Node>
JSTypeExpression. getAllTypeNodes()
Returns a list of all type nodes in this type expression.java.util.Collection<Node>
JSDocInfo. getTypeNodes()
Returns a collection of all type nodes that are a part of this JSDocInfo.com.google.common.collect.ImmutableMap<java.lang.String,Node>
JSDocInfo. getTypeTransformations()
Gets the type transformations.java.util.Iterator<Node>
Node.AncestorIterable. iterator()
Methods in com.google.javascript.rhino with parameters of type Node Modifier and Type Method Description static Node
IR. add(Node expr1, Node expr2)
void
Node. addChildrenAfter(Node children, Node node)
Add all children after 'node'.void
Node. addChildrenToBack(Node children)
void
Node. addChildrenToFront(Node children)
Add all children to the front of this node.void
Node. addChildToBack(Node child)
void
Node. addChildToFront(Node child)
static Node
IR. and(Node expr1, Node expr2)
static Node
IR. arraylit(Node... exprs)
static Node
IR. arrayPattern(Node... keys)
static Node
TypeDeclarationsIR. arrayType(Node elementType)
Represents an array type.static Node
IR. arrowFunction(Node name, Node params, Node body)
static Node
IR. assign(Node target, Node expr)
static Node
IR. assignAnd(Node expr1, Node expr2)
"&&="static Node
IR. assignCoalesce(Node expr1, Node expr2)
"??="static Node
IR. assignOr(Node expr1, Node expr2)
"||="static Node
IR. await(Node expr)
static Node
IR. block(Node stmt)
static Node
IR. block(Node... stmts)
static Node
IR. breakNode(Node name)
static Node
IR. call(Node target, Node... args)
static Node
IR. caseNode(Node expr, Node body)
static Node
IR. cast(Node expr1, JSDocInfo jsdoc)
static Node
IR. catchNode(Node expr, Node body)
Node
Node. clonePropsFrom(Node other)
Clone the properties from the provided node without copying the property object.static Node
IR. coalesce(Node expr1, Node expr2)
static Node
IR. comma(Node expr1, Node expr2)
static Node
IR. computedProp(Node key, Node value)
static Node
IR. constNode(Node lhs, Node value)
static Node
IR. continueNode(Node name)
static Node
IR. continueOptChainCall(Node target, Node... args)
static Node
IR. continueOptChainGetelem(Node target, Node elem)
static Node
IR. continueOptChainGetprop(Node target, java.lang.String prop)
Node
Node. copyTypeFrom(Node other)
Copies a nodes JSType or Color (if present)static Node
IR. dec(Node exp, boolean isPost)
static Node
IR. declaration(Node lhs, Node value, Token type)
static Node
IR. declaration(Node lhs, Token type)
void
NominalTypeBuilder. declareConstructorProperty(java.lang.String name, JSType type, Node defSite)
Declares a static property on the nominal type's constructor.void
NominalTypeBuilder. declareInstanceProperty(java.lang.String name, JSType type, Node defSite)
Declares an instance property on the nominal type.void
NominalTypeBuilder. declarePrototypeProperty(java.lang.String name, JSType type, Node defSite)
Declares a property on the nominal type's prototype.static Node
IR. defaultCase(Node body)
static Node
IR. delprop(Node target)
static Node
IR. doNode(Node body, Node cond)
static Node
IR. eq(Node expr1, Node expr2)
"=="static Node
IR. export(Node declaration)
static Node
IR. exprResult(Node expr)
static Node
IR. forIn(Node target, Node cond, Node body)
static Node
IR. forNode(Node init, Node cond, Node incr, Node body)
static Node
IR. function(Node name, Node params, Node body)
static Node
TypeDeclarationsIR. functionType(Node returnType, java.util.LinkedHashMap<java.lang.String,Node> requiredParams, java.util.LinkedHashMap<java.lang.String,Node> optionalParams, java.lang.String restName, Node restType)
Represents a function type.static Node
IR. ge(Node expr1, Node expr2)
">="static Node
IR. getelem(Node target, Node elem)
int
Node. getIndexOfChild(Node child)
Gets the index of a child, note that this is O(N) where N is the number of children.static Node
IR. getprop(Node target, java.lang.String prop)
static Node
IR. getprop(Node target, java.lang.String prop, java.lang.String... moreProps)
static Node
IR. getterDef(java.lang.String name, Node value)
boolean
Node. hasChild(Node child)
static Node
IR. hook(Node cond, Node trueval, Node falseval)
static Node
IR. ifNode(Node cond, Node then)
static Node
IR. ifNode(Node cond, Node then, Node elseNode)
static Node
IR. importNode(Node name, Node importSpecs, Node moduleIdentifier)
static Node
IR. in(Node expr1, Node expr2)
static Node
IR. inc(Node exp, boolean isPost)
void
Node. insertAfter(Node existing)
void
Node. insertBefore(Node existing)
boolean
Node. isDescendantOf(Node node)
boolean
Node. isEquivalentTo(Node node)
Returns true if this node is equivalent semantically to anotherboolean
Node. isEquivalentTo(Node node, boolean compareType, boolean recurse, boolean jsDoc, boolean sideEffect)
boolean
Node. isEquivalentToShallow(Node node)
Checks equivalence without going into child nodesboolean
Node. isEquivalentToTyped(Node node)
Returns true if this node is equivalent semantically to another and the types are equivalent.boolean
Node. isEquivalentWithSideEffectsTo(Node node)
Returns true if this node is equivalent semantically to another including side effects.boolean
Node. isEquivalentWithSideEffectsToShallow(Node node)
Returns true if this node is equivalent semantically to another including side effects.boolean
Node. isFirstChildOf(Node possibleParent)
boolean
Node. isOnlyChildOf(Node possibleParent)
boolean
Node. isSecondChildOf(Node possibleParent)
static Node
IR. iterRest(Node target)
static Node
IR. iterSpread(Node expr)
static Node
IR. label(Node name, Node stmt)
static Node
IR. let(Node lhs)
static Node
IR. let(Node lhs, Node value)
static Node
IR. lt(Node expr1, Node expr2)
"<"void
JSDocInfo.Builder. markName(java.lang.String name, Node templateNode, int lineno, int charno)
Adds a name declaration to the current marker.void
JSDocInfo.Builder. markTypeNode(Node typeNode, int lineno, int startCharno, int endLineno, int endCharno, boolean hasLC)
Adds a type declaration to the current marker.abstract boolean
QualifiedName. matches(Node n)
Checks whether the given node matches this name.boolean
Node. matchesName(Node n)
Check that if two NAME node match, returns false if either node is not a NAME node.boolean
Node. matchesQualifiedName(Node n)
Returns whether a node matches a simple or a qualified name, such asx
ora.b.c
orthis.a
.static boolean
IR. mayBeExpression(Node n)
It isn't possible to always determine if a detached node is a expression, so make a best guess.static boolean
IR. mayBeStatement(Node n)
It isn't possible to always determine if a detached node is a expression, so make a best guess.static Node
IR. memberFieldDef(java.lang.String name, Node value)
static Node
IR. memberFunctionDef(java.lang.String name, Node function)
static Node
IR. ne(Node expr1, Node expr2)
"!="static Node
IR. neg(Node expr1)
static Node
IR. newNode(Node target, Node... args)
static Node
IR. not(Node expr1)
static Node
IR. objectlit(Node... propdefs)
static Node
IR. objectPattern(Node... keys)
static Node
IR. objectRest(Node target)
static Node
IR. objectSpread(Node expr)
static Node
TypeDeclarationsIR. optionalParameter(Node parameterType)
Represents a function parameter that is optional.static Node
IR. or(Node expr1, Node expr2)
static Node
TypeDeclarationsIR. parameterizedType(Node baseType, java.lang.Iterable<Node> typeParameters)
Represents a parameterized, or generic, type.static Node
IR. paramList(Node... params)
static Node
IR. pos(Node expr1)
static Node
IR. propdef(Node string, Node value)
static Node
IR. quotedStringKey(java.lang.String s, Node value)
boolean
JSDocInfo.Builder. recordTypeTransformation(java.lang.String name, Node expr)
Records a type transformation expression together with its template type name.static Node
IR. regexp(Node expr)
static Node
IR. regexp(Node expr, Node flags)
void
Node. replaceWith(Node replacement)
Swaps `replacement` and its subtree into the position of `this`.static Node
IR. returnNode(Node expr)
static Node
IR. root(Node... rootChildren)
static Node
IR. script(Node... stmts)
void
Node. setDeclaredTypeExpression(Node typeExpression)
Sets the syntactical type specified on this node.void
Node. setStaticSourceFileFrom(Node other)
static Node
IR. setterDef(java.lang.String name, Node value)
static Node
IR. sheq(Node expr1, Node expr2)
"==="static Node
IR. shne(Node expr1, Node expr2)
"!=="Node
Node. srcref(Node other)
Copy the source info from `other` onto `this`.Node
Node. srcrefIfMissing(Node other)
Iff source info is not set on `this`, copy the source info from `other`.Node
Node. srcrefTree(Node other)
For all Nodes in the subtree of `this`, copy the source info from `other`.Node
Node. srcrefTreeIfMissing(Node other)
For all Nodes in the subtree of `this`, iff source info is not set, copy the source info from `other`.static Node
IR. startOptChainCall(Node target, Node... args)
static Node
IR. startOptChainGetelem(Node target, Node elem)
static Node
IR. startOptChainGetprop(Node target, java.lang.String prop)
static Node
IR. stringKey(java.lang.String s, Node value)
static Node
IR. sub(Node expr1, Node expr2)
static Node
IR. switchNode(Node cond, Node... cases)
static Node
IR. throwNode(Node expr)
static Node
IR. tryCatch(Node tryBody, Node catchNode)
static Node
IR. tryCatchFinally(Node tryBody, Node catchNode, Node finallyBody)
static Node
IR. tryFinally(Node tryBody, Node finallyBody)
static Node
IR. typeof(Node expr)
static Node
TypeDeclarationsIR. unionType(Node... options)
static Node
IR. var(Node lhs)
static Node
IR. var(Node lhs, Node value)
static Node
IR. voidNode(Node expr1)
static Node
IR. whileNode(Node cond, Node body)
static Node
IR. yield(Node expr)
Method parameters in com.google.javascript.rhino with type arguments of type Node Modifier and Type Method Description static Node
IR. arraylit(java.lang.Iterable<Node> exprs)
static Node
IR. block(java.util.List<Node> stmts)
static Node
TypeDeclarationsIR. functionType(Node returnType, java.util.LinkedHashMap<java.lang.String,Node> requiredParams, java.util.LinkedHashMap<java.lang.String,Node> optionalParams, java.lang.String restName, Node restType)
Represents a function type.static Node
TypeDeclarationsIR. parameterizedType(Node baseType, java.lang.Iterable<Node> typeParameters)
Represents a parameterized, or generic, type.static Node
TypeDeclarationsIR. recordType(java.util.LinkedHashMap<java.lang.String,Node> properties)
Represents a structural type.static Node
IR. script(java.util.List<Node> stmts)
static Node
TypeDeclarationsIR. unionType(java.lang.Iterable<Node> options)
Represents a union type, which can be one of the given types.Constructors in com.google.javascript.rhino with parameters of type Node Constructor Description JSTypeExpression(Node root, java.lang.String sourceName)
Node(Token token, Node child)
Node(Token token, Node left, Node right)
Node(Token token, Node left, Node mid, Node right)
-
Uses of Node in com.google.javascript.rhino.jstype
Methods in com.google.javascript.rhino.jstype that return Node Modifier and Type Method Description Node
Property. getNode()
Node
SimpleReference. getNode()
Node
ObjectType. getOwnPropertyDefSite(java.lang.String propertyName)
Node
ObjectType. getPropertyDefSite(java.lang.String propertyName)
Node
ObjectType. getPropertyNode(java.lang.String propertyName)
Gets the node corresponding to the definition of the specified property.Node
EnumType. getSource()
Node
FunctionType. getSource()
Gets the source node or null if this is an unknown function.Node
JSType.WithSourceRef. getSource()
The node representing the declaration of this type.Node
TemplateType. getTypeTransformation()
Methods in com.google.javascript.rhino.jstype with parameters of type Node Modifier and Type Method Description RecordTypeBuilder
RecordTypeBuilder. addProperty(java.lang.String name, JSType type, Node propertyNode)
Adds a property with the given name and type to the record type.FunctionType
JSTypeRegistry. createConstructorType(java.lang.String name, Node source, java.util.List<FunctionType.Parameter> parameters, JSType returnType, com.google.common.collect.ImmutableList<TemplateType> templateKeys, boolean isAbstract)
Creates a constructor function type.TemplateType
JSTypeRegistry. createTemplateTypeWithTransformation(java.lang.String name, Node expr)
JSType
JSTypeRegistry. createTypeFromCommentNode(Node n)
JSType
JSTypeRegistry. createTypeFromCommentNode(Node n, java.lang.String sourceName, StaticTypedScope scope)
Creates a JSType from the nodes representing a type.boolean
ObjectType. defineDeclaredProperty(java.lang.String propertyName, JSType type, Node propertyNode)
Defines a property whose type is explicitly declared by the programmer.boolean
EnumType. defineElement(java.lang.String name, Node definingNode)
Defines a new element on this enum.boolean
ObjectType. defineInferredProperty(java.lang.String propertyName, JSType type, Node propertyNode)
Defines a property whose type is inferred.boolean
ObjectType. defineSynthesizedProperty(java.lang.String propertyName, JSType type, Node propertyNode)
Defines a property whose type is on a synthesized object.java.lang.String
JSTypeRegistry. getReadableTypeName(Node n)
First dereferences the JSType to remove null/undefined then returns a human-readable type namejava.lang.String
JSTypeRegistry. getReadableTypeNameNoDeref(Node n)
void
JSTypeRegistry. registerNonLegacyClosureNamespace(java.lang.String moduleName, Node definitionNode, JSType type)
Registers a goog.module namespace (that does not have goog.module.declareLegacyNamespace)void
JSTypeRegistry. registerTemplateTypeNamesInScope(java.lang.Iterable<TemplateType> keys, Node scopeRoot)
Registers template types on the given scope root.void
Property. setNode(Node n)
void
ObjectType. setPropertyNode(java.lang.String propertyName, Node defSite)
Sets the node where the property was defined.void
PrototypeObjectType. setPropertyNode(java.lang.String propertyName, Node defSite)
EnumType.Builder
EnumType.Builder. setSource(Node x)
The object literal that creates the enum, a reference to another enum, or null.void
FunctionType. setSource(Node source)
Sets the source node.FunctionType.Builder
FunctionType.Builder. withSourceNode(Node sourceNode)
Set the source node of the function type.Constructors in com.google.javascript.rhino.jstype with parameters of type Node Constructor Description SimpleReference(T symbol, Node node)
-