Uses of Class
com.google.javascript.rhino.Node
Packages that use Node
Package
Description
-
Uses of Node in com.google.javascript.jscomp
Methods in com.google.javascript.jscomp that return NodeModifier and TypeMethodDescriptionstatic Node
NodeUtil.emptyFunction()
protected Node
Compiler.ensureLibraryInjected
(String resourceName, boolean force) static @Nullable 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 @Nullable Node
NodeUtil.getAssignedValue
(Node n) For an assignment or variable declaration get the assigned value.CompilerInput.getAstRoot
(AbstractCompiler compiler) static @Nullable Node
NodeUtil.getBestJSDocInfoNode
(Node n) Deprecated.because we want to control the input node tokens accepted by this function.static @Nullable Node
NodeUtil.getBestJsDocInfoNodeStrict
(Node n) Find the best JSDocInfo node for the given node.static @Nullable 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) @Nullable Node
NodeTraversal.getClosestHoistScopeRoot()
@Nullable Node
NodeTraversal.getClosestScopeRootNodeBindingThisOrSuper()
Returns the closest scope binding the `this` or `super` keyword@Nullable Node
DestructuredTarget.getComputedProperty()
Returns a COMPUTED_PROP node or nullNodeTraversal.getCurrentNode()
Returns the node currently being traversed.@Nullable Node
NodeTraversal.getCurrentScript()
Returns the SCRIPT node enclosing the current scope@Nullable Node
SymbolTable.Symbol.getDeclarationNode()
static Node
NodeUtil.getDeclaringParent
(Node targetNode) Returns the node that is effectively declaring the given target.@Nullable 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.@Nullable 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.getEnclosingHoistScopeRoot
(Node n) Return the nearest enclosing hoist scope root node, null for the global scope.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 @Nullable 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) final @Nullable Node
AbstractVar.getInitialValue()
protected Node
Compiler.getJsRoot()
abstract Node
TypeMismatch.getLocation()
The location of the assignment.static @Nullable Node
NodeUtil.getLoopCodeBlock
(Node n) IcuTemplateDefinition.getMessageNode()
The RHS node of the message assignment statement.JsMessageDefinition.getMessageNode()
The RHS node of the message assignment statement.final Node
AbstractVar.getNameNode()
static @Nullable Node
NodeUtil.getNameNode
(Node n) Gets the node of a function or class's name.final Node
AbstractVar.getNode()
DestructuredTarget.getNode()
ImplicitNullabilityCheck.Result.getNode()
abstract @Nullable Node
JSError.getNode()
Node where the warning occurred.Reference.getNode()
protected Node
Compiler.getNodeForCodeInsertion
(@Nullable JSChunk chunk) final @Nullable Node
AbstractVar.getParentNode()
@Nullable Node
JsMessageDefinition.getPlaceholderValuesNode()
The object literalNode
that maps placeholder names to expressions providing their values.abstract Node
AbstractCompiler.getRoot()
Returns the root node of the AST, which includes both externs and source.Compiler.getRoot()
final 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 @Nullable Node
NodeUtil.getRValueOfLValue
(Node n) Gets the r-value (or initializer) of a node returned by getBestLValue.final Node
AbstractVar.getScopeRoot()
@Nullable Node
NodeTraversal.getScopeRoot()
Returns the current scope's root.abstract @Nullable Node
AbstractCompiler.getScriptNode
(String filename) final @Nullable Node
Compiler.getScriptNode
(String filename) @Nullable Node
DestructuredTarget.getStringKey()
Returns a STRING_KEY node or nullIcuTemplateDefinition.getTemplateTextNode()
The Node representing the message text template.JsMessageDefinition.getTemplateTextNode()
The Node representing the message text template.@Nullable Node
JsMessageVisitor.ObjectLiteralMap.getValueNode
(String key) Get the value node for a key.static Node
NodeUtil.newDeclaration
(Node lhs, @Nullable Node rhs, Token declarationType) static Node
NodeUtil.newPropertyAccess
(AbstractCompiler compiler, Node context, String name) Creates a property access on thecontext
tree.static Node
NodeUtil.newQName
(AbstractCompiler compiler, String name) Creates a node representing a qualified name.static Node
NodeUtil.newQNameDeclaration
(AbstractCompiler compiler, String name, Node value, JSDocInfo info) Creates a node representing a qualified name.static Node
NodeUtil.newQNameDeclaration
(AbstractCompiler compiler, 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"Compiler.parse
(SourceFile file) abstract Node
AbstractCompiler.parseSyntheticCode
(String filename, String code) Parses code for injecting, and associate it with a given source file.Compiler.parseSyntheticCode
(String fileName, String js) Methods in com.google.javascript.jscomp that return types with arguments of type NodeModifier and TypeMethodDescriptionControlFlowAnalysis.Builder.computeCfg()
JsMessageVisitor.ObjectLiteralMap.extractAsValueMap()
Returns a map from object property names the Node values they have in the AST, building the map first, if necessary.SymbolTable.getAllJSDocInfoNodes()
NodeTraversal.AbstractCfgCallback.getControlFlowGraph
(AbstractCompiler compiler) Gets the control flow graph for the current JS scope.CompilerOptions.getDefineReplacements()
Returns the map of define replacements.InvalidatingTypes.getMismatchLocations()
NodeUtil.getParentChangeScopeNodes
(List<Node> scopeNodes) Returns the list of scope nodes which are parents of the provided list of scope nodes.JsMessageDefinition.getPlaceholderValueMap()
A map from placehlolder name to the Node assigned to it in the values map argument of `goog.getMsg()`.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) NodeUtil.preOrderIterable
(Node root) Same asNodeUtil.preOrderIterable(Node, Predicate)
but iterates over all nodes in the tree without exception.NodeUtil.preOrderIterable
(Node root, com.google.common.base.Predicate<Node> travserseNodePredicate) Create anIterable
over the given node and all descendents.NodeUtil.removeNestedChangeScopeNodes
(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 NodeModifier and TypeMethodDescriptionprotected void
protected void
CodeGenerator.add
(Node node, CodeGenerator.Context context) protected void
CodeGenerator.add
(Node node, CodeGenerator.Context context, boolean printComments) Generate the current nodevoid
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 checkfinal void
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.BanElementSetAttribute.checkConformance
(NodeTraversal traversal, Node node) 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.BannedModsRegex.checkConformance
(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResult
ConformanceRules.BanNonLiteralArgsToGoogStringConstFrom.checkConformance
(NodeTraversal t, Node node) protected ConformanceRules.ConformanceResult
ConformanceRules.BanNullDeref.checkConformance
(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResult
ConformanceRules.BanSettingAttributes.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) ConformanceRules.SecuritySensitiveAttributes.checkConformanceForAttributeName
(NodeTraversal traversal, Node attrName) Given aNodeTraversal
andNode
, check if the attribute violates conformance.ConformanceRules.SecuritySensitiveAttributes.checkConformanceForAttributeNameWithHighConfidence
(NodeTraversal traversal, Node attrName) Given aNodeTraversal
andNode
, check if the attribute violates conformance.void
CodingConvention.checkForCallingConventionDefinitions
(Node getPropNode, Map<String, String> delegateCallingConventions) Checks for getprops that set the calling conventions on delegate methods.void
CodingConventions.Proxy.checkForCallingConventionDefinitions
(Node n, Map<String, String> delegateCallingConventions) protected void
Checks a node's type.static com.google.common.collect.ImmutableSet
<String> NodeUtil.collectExternVariableNames
(AbstractCompiler compiler, Node externs) static int
NodeUtil.countAstSize
(Node n) 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 nodesSyntacticScopeCreator.createScope
(Node n, AbstractScope<?, ?> parent) SyntacticScopeCreator.createScope
(Node n, Scope parent) static boolean
CodingConventions.defaultIsFunctionCallThatAlwaysThrows
(Node n, String alwaysThrowsFunctionName) 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.@Nullable CodingConvention.Cache
ClosureCodingConvention.describeCachingCall
(Node node) 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.CodingConventions.Proxy.describeCachingCall
(Node node) @Nullable CodingConvention.Bind
ClosureCodingConvention.describeFunctionBind
(Node n, boolean callerChecksTypes, boolean iCheckTypes) CodingConvention.describeFunctionBind
(Node n) A Bind instance or null.CodingConvention.describeFunctionBind
(Node n, boolean callerChecksTypes, boolean iCheckTypes) A Bind instance or null.CodingConventions.Proxy.describeFunctionBind
(Node n) 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.static int
NodeUtil.estimateNumLines
(Node scriptNode) Estimates the number of lines in the file of this script node.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.ClosureCodingConvention.extractClassNameIfProvide
(Node node, Node parent) Extracts X from goog.provide('X'), if the applied Node is goog.CodingConvention.extractClassNameIfProvide
(Node node, Node parent) Convenience method for determining provided dependencies amongst different JS scripts.CodingConventions.Proxy.extractClassNameIfProvide
(Node node, Node parent) ClosureCodingConvention.extractClassNameIfRequire
(Node node, Node parent) Extracts X from goog.require('X'), if the applied Node is goog.CodingConvention.extractClassNameIfRequire
(Node node, Node parent) Convenience method for determining required dependencies amongst different JS scripts.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) JsMessageVisitor.extractObjectLiteralMap
(@Nullable Node objLit) Returns an object to represent an object literal Node from the AST.static @Nullable 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 @Nullable 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 @Nullable Node
NodeUtil.getAssignedValue
(Node n) For an assignment or variable declaration get the assigned value.static @Nullable JSDocInfo
NodeUtil.getBestJSDocInfo
(Node n) Find the best JSDoc for the given node.static @Nullable Node
NodeUtil.getBestJSDocInfoNode
(Node n) Deprecated.because we want to control the input node tokens accepted by this function.static @Nullable Node
NodeUtil.getBestJsDocInfoNodeStrict
(Node n) Find the best JSDocInfo node for the given node.static @Nullable Node
NodeUtil.getBestLValue
(Node n) Find the l-value that the given r-value is being assigned to.static @Nullable String
NodeUtil.getBestLValueName
(@Nullable 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.@Nullable 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.getClassesDefinedByCall
(Node callNode) Checks if the given method defines a subclass relationship, and if it does, returns information on that relationship.CodingConventions.Proxy.getClassesDefinedByCall
(Node callNode) static Node
NodeUtil.getClassMembers
(Node n) ProcessCommonJSModules.getCommonJsImportPath
(Node requireCall) static 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 @Nullable 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.getDelegateRelationship
(Node callNode) 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.getEnclosingFunctionScope
(Node n) Gets the scope that contains the given node.static Node
NodeUtil.getEnclosingHoistScopeRoot
(Node n) Return the nearest enclosing hoist scope root node, null for the global scope.static Node
NodeUtil.getEnclosingModuleIfPresent
(Node n) static Node
NodeUtil.getEnclosingNode
(Node n, com.google.common.base.Predicate<Node> pred) @Nullable 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 @Nullable 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 @Nullable NodeUtil.GoogRequire
NodeUtil.getGoogRequireInfo
(Node nameNode) static @Nullable 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 @Nullable Node
NodeUtil.getLoopCodeBlock
(Node n) static @Nullable String
static @Nullable Node
NodeUtil.getNameNode
(Node n) Gets the node of a function or class's name.static @Nullable String
NodeUtil.getNearestFunctionName
(Node n) Gets the function's name.@Nullable CodingConvention.ObjectLiteralCast
ClosureCodingConvention.getObjectLiteralCast
(Node callNode) CodingConvention.getObjectLiteralCast
(Node callNode) Checks if the given method performs a object literal cast, and if it does, returns information on the cast.CodingConventions.Proxy.getObjectLiteralCast
(Node callNode) static void
NodeUtil.getParamOrPatternNames
(Node n, 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 @Nullable Node
NodeUtil.getRValueOfLValue
(Node n) Gets the r-value (or initializer) of a node returned by getBestLValue.ChromeCodingConvention.getSingletonGetterClassName
(Node callNode) ClosureCodingConvention.getSingletonGetterClassName
(Node callNode) 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.CodingConventions.Proxy.getSingletonGetterClassName
(Node callNode) static StaticSourceFile
NodeUtil.getSourceFile
(Node n) static String
NodeUtil.getSourceName
(Node n) static @Nullable 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
<String> ConformanceAllowlister.getViolatingPaths
(Compiler compiler, Node externs, Node ast, com.google.javascript.jscomp.Requirement requirement) void
AstValidator.ViolationHandler.handleViolation
(String message, Node n) static boolean
NodeUtil.has
(Node node, com.google.common.base.Predicate<Node> pred, com.google.common.base.Predicate<Node> traverseChildrenPred) ClosureCodingConvention.identifyTypeDeclarationCall
(Node n) 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.CodingConventions.Proxy.identifyTypeDeclarationCall
(Node n) static boolean
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, String label) Checks if target is actually the break target of labeled continue.static boolean
NodeUtil.isCallOrNew
(Node node) static boolean
A faster version ofNodeUtil.isCallTo(Node, String)
.static boolean
NodeUtil.isCallTo
(Node n, QualifiedName qualifiedName) static boolean
static boolean
NodeUtil.isClassDeclaration
(Node n) Is this a class declaration.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.isHoistScopeRoot
(Node n) static boolean
NodeUtil.isImportedName
(Node n) static boolean
NodeUtil.isInFunction
(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
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.isShallowStatementTree
(Node n) Whether the given node's subtree may contain statements, excepting nested functionsstatic 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
(com.google.javascript.jscomp.Requirement requirement, Node n, DiagnosticType type, String... arguments) Creates a JSError from a requirement, file and Node position.static JSError
JSError.make
(Node n, DiagnosticType type, String... arguments) Creates a JSError from a file and Node position.static JSError
JSError.make
(Node start, Node end, DiagnosticType type, 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
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, @Nullable Node rhs, Token declarationType) static Node
NodeUtil.newPropertyAccess
(AbstractCompiler compiler, Node context, String name) Creates a property access on thecontext
tree.static Node
NodeUtil.newQNameDeclaration
(AbstractCompiler compiler, String name, Node value, JSDocInfo info) Creates a node representing a qualified name.static Node
NodeUtil.newQNameDeclaration
(AbstractCompiler compiler, 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"NodeUtil.preOrderIterable
(Node root) Same asNodeUtil.preOrderIterable(Node, Predicate)
but iterates over all nodes in the tree without exception.NodeUtil.preOrderIterable
(Node root, com.google.common.base.Predicate<Node> travserseNodePredicate) Create anIterable
over the given node and all descendents.protected void
CodeGenerator.printLeadingCommentsInOrder
(Node node) Print Leading JSDocComments or NonJSDocComments for the given node in order, depending on their source location.protected void
CodeGenerator.printTrailingComment
(Node node) void
void
void
void
void
void
void
Process the JS with root node root.void
void
void
void
Convenience method for running this pass over a tree with this class as a callback.void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
Convenience method for running this pass over a tree with this class as a callback.void
void
void
void
void
void
void
Module rewriting is done a on per-file basis prior to main compilation.void
void
void
void
void
Main entry point for this phase of processing.void
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, String... arguments) Reports a diagnostic (error or warning)void
NodeTraversal.report
(Node start, Node end, DiagnosticType diagnosticType, String... arguments) Reports a diagnostic (error or warning) This variant is particularly useful for reporting on GETPROP nodes whose length is otherwise just the last component (`abc` in `foo.abc`).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) ControlFlowAnalysis.Builder.setCfgRoot
(Node cfgRoot) boolean
CheckConformance.Precondition.shouldCheck
(Node n) final boolean
CheckConformance.shouldTraverse
(NodeTraversal t, Node n, Node parent) boolean
CheckMissingRequires.shouldTraverse
(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, Node scopeRoot) boolean
ControlFlowAnalysis.shouldTraverse
(NodeTraversal nodeTraversal, Node n, Node parent) final 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
Es6RewriteClassExtendsExpressions.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
ExtraRequireRemover.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
InstrumentAsyncContext.shouldTraverse
(NodeTraversal t, Node n, Node parent) boolean
LateEs6ToEs3Converter.shouldTraverse
(NodeTraversal t, Node n, Node parent) boolean
NodeTraversal.AbstractCfgCallback.shouldTraverse
(NodeTraversal t, Node n, Node parent) final boolean
NodeTraversal.AbstractChangedScopeCallback.shouldTraverse
(NodeTraversal t, Node n, Node parent) protected boolean
NodeTraversal.AbstractModuleCallback.shouldTraverse
(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, @Nullable Node moduleScopeRoot) final boolean
NodeTraversal.AbstractModuleCallback.shouldTraverse
(NodeTraversal t, Node n, Node parent) final boolean
NodeTraversal.AbstractPostOrderCallback.shouldTraverse
(NodeTraversal nodeTraversal, Node n, Node parent) final boolean
NodeTraversal.AbstractScopedCallback.shouldTraverse
(NodeTraversal nodeTraversal, Node n, Node parent) final boolean
NodeTraversal.AbstractShallowCallback.shouldTraverse
(NodeTraversal nodeTraversal, Node n, Node parent) final boolean
NodeTraversal.AbstractShallowStatementCallback.shouldTraverse
(NodeTraversal nodeTraversal, Node n, Node parent) boolean
NodeTraversal.Callback.shouldTraverse
(NodeTraversal t, Node n, @Nullable Node parent) Visits a node in preorder (before its children) and decides whether the node and its children should be traversed.final boolean
NodeTraversal.ExternsSkippingCallback.shouldTraverse
(NodeTraversal t, Node n, Node parent) boolean
ProcessCommonJSModules.shouldTraverse
(NodeTraversal t, Node n, Node parent) boolean
RewriteAsyncFunctions.shouldTraverse
(NodeTraversal t, Node n, Node parent) boolean
RewriteAsyncIteration.shouldTraverse
(NodeTraversal nodeTraversal, Node n, Node parent) boolean
RewriteClassMembers.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) protected boolean
Compiler.ScriptNodeLicensesOnlyTracker.shouldUseLicenseInfo
(Node node) protected boolean
Compiler.SingleBinaryLicenseTracker.shouldUseLicenseInfo
(Node node) void
Es6SplitVariableDeclarations.splitDeclaration
(NodeTraversal t, Node n, Node parent) static String
Converts an AST to dot representation.abstract String
Prints a node to source code.void
Compiler.toSource
(Compiler.CodeBuilder cb, CodePrinter.LicenseTracker licenseTracker, int inputSeqNum, Node root) Writes out JS code from a root node.Generates JavaScript source code for an AST, doesn't generate source map info.void
CodePrinter.LicenseTracker.trackLicensesForNode
(Node node) void
Compiler.ChunkGraphAwareLicenseTracker.trackLicensesForNode
(Node node) void
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, @Nullable Node root, @Nullable 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
CheckMissingRequires.visit
(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, @Nullable 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, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, @Nullable 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
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
ExtraRequireRemover.visit
(NodeTraversal t, Node n, Node parent) Visits each corresponding node and tracks all goog.requires as well as their usagesvoid
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
InstrumentAsyncContext.visit
(NodeTraversal t, Node n, @Nullable 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
NodeTraversal.AbstractCfgCallback.visit
(NodeTraversal t, Node n, Node parent) protected void
NodeTraversal.AbstractModuleCallback.visit
(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, @Nullable Node moduleScopeRoot) final void
NodeTraversal.AbstractModuleCallback.visit
(NodeTraversal t, Node n, Node parent) void
NodeTraversal.AbstractPostOrderCallbackInterface.visit
(NodeTraversal t, Node n, Node parent) final void
NodeTraversal.AbstractPreOrderCallback.visit
(NodeTraversal t, Node n, Node parent) void
NodeTraversal.Callback.visit
(NodeTraversal t, Node n, @Nullable Node parent) Visits a node in postorder (after its children).void
void
RewriteAsyncFunctions.visit
(NodeTraversal t, Node n, Node parent) void
RewriteAsyncIteration.visit
(NodeTraversal t, Node n, Node parent) void
RewriteClassMembers.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.visitLhsNodesInDestructuringPattern
(Node destructuringPattern, Consumer<Node> consumer) Retrieves lhs nodes declared or assigned in a given destructuring pattern node.static void
NodeUtil.visitLhsNodesInNode
(Node assigningParent, Consumer<Node> consumer) Retrieves lhs nodes declared or assigned in a given assigning parent node.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 NodeModifier and TypeMethodDescriptionstatic @Nullable 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, Consumer<Node> cb) Callscb
with all NAMEs declared in a PARAM_LIST or destructuring pattern.NodeUtil.getParentChangeScopeNodes
(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) NodeUtil.preOrderIterable
(Node root, com.google.common.base.Predicate<Node> travserseNodePredicate) Create anIterable
over the given node and all descendents.NodeUtil.removeNestedChangeScopeNodes
(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, @Nullable Node root, @Nullable 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.visitLhsNodesInDestructuringPattern
(Node destructuringPattern, Consumer<Node> consumer) Retrieves lhs nodes declared or assigned in a given destructuring pattern node.static void
NodeUtil.visitLhsNodesInNode
(Node assigningParent, Consumer<Node> consumer) Retrieves lhs nodes declared or assigned in a given assigning parent node.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 NodeModifierConstructorDescriptionSets the root node from which to generate the source code.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 -
Uses of Node in com.google.javascript.jscomp.ijs
Methods in com.google.javascript.jscomp.ijs with parameters of type Node -
Uses of Node in com.google.javascript.jscomp.instrumentation
Methods in com.google.javascript.jscomp.instrumentation with parameters of type Node -
Uses of Node in com.google.javascript.jscomp.lint
Methods in com.google.javascript.jscomp.lint that return NodeModifier and TypeMethodDescriptionCheckProvidesSorted.getFirstNode()
Returns the node for the first recognized provide statement.CheckRequiresSorted.getFirstNode()
Returns the node for the first recognized import statement.CheckProvidesSorted.getLastNode()
Returns the node for the last recognized provide statement.CheckRequiresSorted.getLastNode()
Returns the node for the last recognized import statement.Methods in com.google.javascript.jscomp.lint with parameters of type NodeModifier and TypeMethodDescriptionboolean
CheckArrayWithGoogObject.isGoogObjectIterationOverArray
(Node n) void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
boolean
CheckConstantCaseNames.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) final 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) final boolean
CheckRequiresSorted.shouldTraverse
(NodeTraversal t, Node n, Node parent) final boolean
CheckUnusedLabels.shouldTraverse
(NodeTraversal t, Node n, Node parent) boolean
CheckUnusedPrivateProperties.shouldTraverse
(NodeTraversal t, Node n, Node parent) final 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
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) final 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 NodeModifier and TypeMethodDescriptionabstract @Nullable Node
Export.exportNode()
Node that this export originates from.abstract Node
Import.importNode()
Returns the import node for source information.abstract @Nullable Node
Export.nameNode()
Node that this export originates from.abstract Node
Import.nameNode()
Returns the name node for source information.abstract @Nullable Node
ModuleMetadataMap.ModuleMetadata.rootNode()
AST node that represents the root of this module.abstract @Nullable Node
Binding.sourceNode()
The AST node to use for source location when rewriting.Methods in com.google.javascript.jscomp.modules with parameters of type NodeModifier and TypeMethodDescriptioncom.google.javascript.jscomp.modules.UnresolvedModule
EsModuleProcessor.process
(ModuleMetadataMap.ModuleMetadata metadata, ModuleLoader.ModulePath path, Node script) void
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 NodeMethods in com.google.javascript.jscomp.parsing that return NodeModifier and TypeMethodDescriptionTypeTransformationParser.getTypeTransformationAst()
static Node
JsDocInfoParser.parseTypeString
(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 NodeModifier and TypeMethodDescriptionstatic void
ParsingUtil.getParamOrPatternNames
(Node n, 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 NodeModifier and TypeMethodDescriptionstatic void
ParsingUtil.getParamOrPatternNames
(Node n, 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 NodeModifierConstructorDescriptionJsDocInfoParser
(JsDocTokenStream stream, String comment, int commentPosition, @Nullable Node templateNode, Config config, JsDocInfoParser.JsDocSourceKind jsDocSourceKind, ErrorReporter errorReporter) ParseResult
(Node ast, List<Comment> comments, FeatureSet features, 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 NodeModifier and TypeMethodDescriptionabstract ConcurrentMap
<SourceFile, 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 -
Uses of Node in com.google.javascript.jscomp.type
Methods in com.google.javascript.jscomp.type with parameters of type NodeModifier and TypeMethodDescriptionprotected 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.ClosureReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome
(Node condition, FlowScope blindScope, Outcome outcome) ReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome
(Node condition, FlowScope blindScope, Outcome outcome) Calculates a precise version of the scope knowing the outcome of the condition.SemanticReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome
(Node condition, FlowScope blindScope, Outcome outcome) protected @Nullable 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.inferQualifiedSlot
(Node node, 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 NodeModifier and TypeMethodDescriptionMatch.getNode()
Returns the node that matched the given conditions.Methods in com.google.javascript.refactoring that return types with arguments of type NodeModifier and TypeMethodDescriptionJsSourceMatcher.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 NodeModifier and TypeMethodDescriptionSuggestedFix.Builder.addCast
(Node n, AbstractCompiler compiler, String type) Adds a cast of the given type to the provided node.SuggestedFix.Builder.addChildToFront
(Node parentNode, String content) Inserts a new node as the first child of the provided node.SuggestedFix.Builder.addOrReplaceJsDoc
(Node n, String newJsDoc) Adds or replaces the JS Doc for the given node.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.changeJsDocType
(Node n, AbstractCompiler compiler, String type) Changes the JS Doc Type of the given node.static ScriptMetadata
ScriptMetadata.create
(Node script, AbstractCompiler compiler) Deletes a node and its contents from the source file.SuggestedFix.Builder.deleteArgument
(Node n, int position) Deletes an argument from an existing function call, including any JS doc that precedes it.SuggestedFix.Builder.deleteWithoutRemovingWhitespace
(Node n) Deletes a node without touching any surrounding whitespace.SuggestedFix.Builder.deleteWithoutRemovingWhitespaceBefore
(Node n) Deletes a node and its contents from the source file.SuggestedFix.Builder.generateCode
(AbstractCompiler compiler, Node node) SuggestedFix.Builder.insertAfter
(Node node, String text) Inserts the text after the given nodeSuggestedFix.Builder.insertArguments
(Node n, int position, String... args) Inserts arguments into an existing function call.SuggestedFix.Builder.insertBefore
(Node nodeToInsertBefore, Node n, AbstractCompiler compiler) Inserts a new node before the provided node.SuggestedFix.Builder.insertBefore
(Node nodeToInsertBefore, 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.removeCast
(Node n, AbstractCompiler compiler) Removes a cast from the given node.Renames a given node to the provided name.Renames a given node to the provided name.SuggestedFix.Builder.replace
(Node original, Node newNode, AbstractCompiler compiler) Replaces the provided node with new node in the source file.SuggestedFix.Builder.replaceRange
(Node first, Node last, String newContent) Replaces a range of nodes with the given content.Constructors in com.google.javascript.refactoring with parameters of type NodeModifierConstructorDescriptionJsSourceMatcher
(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 NodeModifier and TypeMethodDescriptionboolean
GoogBindToArrow.matches
(Node node, NodeMetadata metadata) -
Uses of Node in com.google.javascript.rhino
Methods in com.google.javascript.rhino that return NodeModifier and TypeMethodDescriptionstatic Node
static Node
static Node
TypeDeclarationsIR.anyType()
Equivalent to the UNKNOWN type in Closure, expressed with{?}
static Node
static Node
static Node
IR.arrayPattern
(Node... keys) static Node
Represents an array type.static Node
IR.arrowFunction
(Node name, Node params, Node body) static Node
static Node
"invalid input: '&'invalid input: '&'="static Node
IR.assignCoalesce
(Node expr1, Node expr2) "??="static Node
"||="static Node
static Node
IR.bigint
(BigInteger b) static Node
IR.bitwiseAnd
(Node expr1, Node expr2) "invalid input: '&'"static Node
IR.block()
static Node
static Node
static Node
static Node
TypeDeclarationsIR.booleanType()
static Node
IR.breakNode()
static Node
static Node
static Node
static Node
static Node
final Node
Node.cloneNode()
Returns a detached clone of the Node, specifically excluding its children.final Node
Node.clonePropsFrom
(Node other) Clone the properties from the provided node without copying the property object.final Node
Node.cloneTree()
Returns a detached clone of the Node and all its children.final Node
Node.cloneTree
(boolean cloneTypeExprs) static Node
static Node
static Node
IR.computedProp
(Node key, Node value) static Node
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, String prop) final Node
Node.copyTypeFrom
(Node other) Copies a nodes JSType or Color (if present)static Node
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
final Node
Node.detach()
Removes this node from its parent, but retains its subtree.static Node
static Node
IR.empty()
static Node
"=="static Node
static Node
IR.exprResult
(Node expr) static Node
IR.falseNode()
static Node
static Node
static Node
static Node
TypeDeclarationsIR.functionType
(Node returnType, LinkedHashMap<String, Node> requiredParams, LinkedHashMap<String, Node> optionalParams, String restName, Node restType) Represents a function type.static Node
">="final @Nullable Node
Node.getAncestor
(int level) Gets the ancestor node relative to this.final Node
Node.getChildAtIndex
(int i) Gets the ith child, note that this is O(N) where N is the number of children.final @Nullable Node
Node.getClosureUnawareShadow()
final @Nullable Node
Node.getDeclaredTypeExpression()
Returns the syntactical type specified on this node.static Node
final @Nullable Node
Node.getFirstChild()
final @Nullable Node
Node.getFirstFirstChild()
Get the first child of the first child.final @Nullable Node
Node.getGrandparent()
final @Nullable Node
Node.getLastChild()
final @Nullable Node
Node.getNext()
StaticRef.getNode()
The node where the reference lives.final Node
Node.getOnlyChild()
final @Nullable Node
Node.getParent()
final @Nullable Node
Node.getPrevious()
static Node
static Node
JSTypeExpression.getRoot()
StaticScope.getRootNode()
Returns the root node associated with this scope.final @Nullable Node
Node.getSecondChild()
static Node
static Node
static Node
static Node
static Node
IR.importMeta()
static Node
IR.importNode
(Node name, Node importSpecs, Node moduleIdentifier) static Node
IR.importStar
(String name) static Node
static Node
static Node
static Node
IR.iterSpread
(Node expr) static Node
static Node
static Node
static Node
static Node
"<"static Node
IR.memberFieldDef
(String name, Node value) static Node
IR.memberFunctionDef
(String name, Node function) static Node
static Node
Produces a tree structure similar to the Rhino AST of a qualified name expression, under a top-level NAMED_TYPE node.static Node
Splits a '.' separated qualified name into a tree of type segments.static Node
"!="static Node
static Node
Node.newBigInt
(BigInteger bigint) static Node
static Node
Node.newNumber
(double number) static Node
Node.newString
(Token token, RhinoStringPool.LazyInternedStringList stringPool, int offset) static Node
static Node
static Node
Node.newTemplateLitString
(RhinoStringPool.LazyInternedStringList stringPool, int cookedOffsetOrNegativeOne, int rawOffset) static Node
Node.newTemplateLitString
(String cooked, String raw) static Node
static Node
IR.nullNode()
static Node
IR.number
(double d) static Node
TypeDeclarationsIR.numberType()
static Node
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
static Node
TypeDeclarationsIR.parameterizedType
(Node baseType, Iterable<Node> typeParameters) Represents a parameterized, or generic, type.static Node
static Node
static Node
static Node
IR.quotedStringKey
(String s, Node value) static Node
TypeDeclarationsIR.recordType
(LinkedHashMap<String, Node> properties) Represents a structural type.static Node
static Node
final @Nullable Node
Node.removeChildren()
Remove all children, but leave them linked to each other.final @Nullable Node
Node.removeFirstChild()
Removes the first child of Node.static Node
IR.returnNode()
static Node
IR.returnNode
(Node expr) static Node
IR.rightShift
(Node expr1, Node expr2) ">>"static Node
static Node
IR.script()
static Node
static Node
final Node
final Node
Node.setJSDocInfo
(JSDocInfo info) Sets theJSDocInfo
attached to this node.final Node
final Node
Node.setLinenoCharno
(int lineno, int charno) Merges the line number and character number in one integer.final Node
Node.setNonJSDocComment
(NonJSDocComment comment) Sets the NonJSDoc comment attached to this node.final Node
Node.setStaticSourceFile
(@Nullable StaticSourceFile file) static Node
final Node
Node.setTrailingNonJSDocComment
(NonJSDocComment comment) static Node
"==="static Node
"!=="final Node
Copy the source info from `other` onto `this`.final Node
Node.srcrefIfMissing
(Node other) Iff source info is not set on `this`, copy the source info from `other`.final Node
Node.srcrefTree
(Node other) For all Nodes in the subtree of `this`, copy the source info from `other`.final 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, String prop) static Node
static Node
static Node
static Node
TypeDeclarationsIR.stringType()
static Node
static Node
IR.superNode()
static Node
IR.switchNode
(Node cond, Node... cases) static Node
IR.templateLiteral()
static Node
IR.templateLiteralString
(@Nullable String cooked, String raw) static Node
IR.templateLiteralSubstitution
(Node child) static Node
IR.thisNode()
static Node
static Node
IR.trueNode()
static Node
static Node
IR.tryCatchFinally
(Node tryBody, Node catchNode, Node finallyBody) static Node
IR.tryFinally
(Node tryBody, Node finallyBody) static Node
static Node
TypeDeclarationsIR.undefinedType()
static Node
static Node
Represents a union type, which can be one of the given types.static Node
static Node
static Node
static Node
TypeDeclarationsIR.voidType()
static Node
static Node
Methods in com.google.javascript.rhino that return types with arguments of type NodeModifier and TypeMethodDescriptionNode.children()
Deprecated.com.google.common.collect.ImmutableList
<Node> JSTypeExpression.getAllTypeNodes()
Returns a list of all type nodes in this type expression.JSDocInfo.getTypeNodes()
Returns a collection of all type nodes that are a part of this JSDocInfo.JSDocInfo.getTypeTransformations()
Gets the type transformations.Node.AncestorIterable.iterator()
Methods in com.google.javascript.rhino with parameters of type NodeModifier and TypeMethodDescriptionstatic Node
final void
Node.addChildrenAfter
(@Nullable Node children, @Nullable Node node) Add all children after 'node'.final void
Node.addChildrenToBack
(Node children) final void
Node.addChildrenToFront
(@Nullable Node children) Add all children to the front of this node.final void
Node.addChildToBack
(Node child) final void
Node.addChildToFront
(Node child) static Node
static Node
static Node
IR.arrayPattern
(Node... keys) static Node
Represents an array type.static Node
IR.arrowFunction
(Node name, Node params, Node body) static Node
static Node
"invalid input: '&'invalid input: '&'="static Node
IR.assignCoalesce
(Node expr1, Node expr2) "??="static Node
"||="static Node
static Node
IR.bitwiseAnd
(Node expr1, Node expr2) "invalid input: '&'"static Node
static Node
static Node
static Node
static Node
static Node
static Node
final Node
Node.clonePropsFrom
(Node other) Clone the properties from the provided node without copying the property object.static Node
static Node
static Node
IR.computedProp
(Node key, Node value) static Node
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, String prop) final Node
Node.copyTypeFrom
(Node other) Copies a nodes JSType or Color (if present)static Node
static Node
IR.declaration
(Node lhs, Node value, Token type) static Node
IR.declaration
(Node lhs, Token type) void
NominalTypeBuilder.declareConstructorProperty
(String name, JSType type, Node defSite) Declares a static property on the nominal type's constructor.void
NominalTypeBuilder.declareInstanceProperty
(String name, JSType type, Node defSite) Declares an instance property on the nominal type.void
NominalTypeBuilder.declarePrototypeProperty
(String name, JSType type, Node defSite) Declares a property on the nominal type's prototype.static Node
IR.defaultCase
(Node body) static Node
static Node
static Node
"=="static Node
static Node
IR.exprResult
(Node expr) static Node
static Node
static Node
static Node
TypeDeclarationsIR.functionType
(Node returnType, LinkedHashMap<String, Node> requiredParams, LinkedHashMap<String, Node> optionalParams, String restName, Node restType) Represents a function type.static Node
">="static Node
final 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
static Node
static Node
final boolean
static Node
static Node
static Node
static Node
IR.importNode
(Node name, Node importSpecs, Node moduleIdentifier) static Node
static Node
final void
Node.insertAfter
(Node existing) final void
Node.insertBefore
(Node existing) final boolean
Node.isDescendantOf
(Node node) Is this Node the same asnode
or a descendant ofnode
?final 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) Returns whether this node is equivalent semantically to the provided node.final boolean
Node.isEquivalentToShallow
(Node node) Checks equivalence without going into child nodesfinal boolean
Node.isEquivalentToTyped
(Node node) Returns true if this node is equivalent semantically to another and the types are equivalent.final boolean
Node.isEquivalentWithSideEffectsTo
(Node node) Returns true if this node is equivalent semantically to another including side effects.final boolean
Node.isEquivalentWithSideEffectsToShallow
(Node node) Returns true if this node is equivalent semantically to another including side effects.final boolean
Node.isFirstChildOf
(Node possibleParent) final boolean
Node.isOnlyChildOf
(Node possibleParent) final boolean
Node.isSecondChildOf
(Node possibleParent) static Node
static Node
IR.iterSpread
(Node expr) static Node
static Node
static Node
static Node
"<"void
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
Checks whether the given node matches this name.final boolean
Node.matchesName
(Node n) Check that if two NAME node match, returns false if either node is not a NAME node.final 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
(String name, Node value) static Node
IR.memberFunctionDef
(String name, Node function) static Node
"!="static Node
static Node
static Node
static Node
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
static Node
TypeDeclarationsIR.parameterizedType
(Node baseType, Iterable<Node> typeParameters) Represents a parameterized, or generic, type.static Node
static Node
static Node
static Node
IR.quotedStringKey
(String s, Node value) boolean
JSDocInfo.Builder.recordTypeTransformation
(String name, Node expr) Records a type transformation expression together with its template type name.static Node
static Node
final void
Node.replaceWith
(Node replacement) Swaps `replacement` and its subtree into the position of `this`.static Node
IR.returnNode
(Node expr) static Node
IR.rightShift
(Node expr1, Node expr2) ">>"static Node
static Node
final void
Node.setClosureUnawareShadow
(@Nullable Node shadowRoot) final void
Node.setDeclaredTypeExpression
(Node typeExpression) Sets the syntactical type specified on this node.final void
Node.setOriginalNameFromName
(Node name) final void
Node.setStaticSourceFileFrom
(Node other) static Node
static Node
"==="static Node
"!=="final Node
Copy the source info from `other` onto `this`.final Node
Node.srcrefIfMissing
(Node other) Iff source info is not set on `this`, copy the source info from `other`.final Node
Node.srcrefTree
(Node other) For all Nodes in the subtree of `this`, copy the source info from `other`.final 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, String prop) static Node
static Node
static Node
IR.switchNode
(Node cond, Node... cases) static Node
IR.templateLiteralSubstitution
(Node child) static Node
static Node
static Node
IR.tryCatchFinally
(Node tryBody, Node catchNode, Node finallyBody) static Node
IR.tryFinally
(Node tryBody, Node finallyBody) static Node
static Node
static Node
static Node
static Node
static Node
static Node
Method parameters in com.google.javascript.rhino with type arguments of type NodeModifier and TypeMethodDescriptionstatic Node
static Node
static Node
TypeDeclarationsIR.functionType
(Node returnType, LinkedHashMap<String, Node> requiredParams, LinkedHashMap<String, Node> optionalParams, String restName, Node restType) Represents a function type.static Node
TypeDeclarationsIR.parameterizedType
(Node baseType, Iterable<Node> typeParameters) Represents a parameterized, or generic, type.static Node
TypeDeclarationsIR.recordType
(LinkedHashMap<String, Node> properties) Represents a structural type.static Node
static Node
Represents a union type, which can be one of the given types.Constructors in com.google.javascript.rhino with parameters of type Node -
Uses of Node in com.google.javascript.rhino.jstype
Methods in com.google.javascript.rhino.jstype that return NodeModifier and TypeMethodDescriptionProperty.getNode()
final Node
SimpleReference.getNode()
final @Nullable Node
ObjectType.getOwnPropertyDefSite
(String propertyName) final Node
ObjectType.getPropertyDefSite
(String propertyName) final @Nullable Node
ObjectType.getPropertyNode
(String propertyName) Gets the node corresponding to the definition of the specified property.final Node
EnumType.getSource()
final Node
FunctionType.getSource()
Gets the source node or null if this is an unknown function.@Nullable Node
JSType.WithSourceRef.getSource()
The node representing the declaration of this type.TemplateType.getTypeTransformation()
Methods in com.google.javascript.rhino.jstype with parameters of type NodeModifier and TypeMethodDescriptionRecordTypeBuilder.addProperty
(String name, JSType type, Node propertyNode) Adds a property with the given name and type to the record type.JSTypeRegistry.createConstructorType
(String name, Node source, List<FunctionType.Parameter> parameters, JSType returnType, @Nullable com.google.common.collect.ImmutableList<TemplateType> templateKeys, boolean isAbstract) Creates a constructor function type.JSTypeRegistry.createTemplateTypeWithTransformation
(String name, Node expr) JSTypeRegistry.createTypeFromCommentNode
(Node n) JSTypeRegistry.createTypeFromCommentNode
(Node n, String sourceName, @Nullable StaticTypedScope scope) Creates a JSType from the nodes representing a type.final boolean
ObjectType.defineDeclaredProperty
(String propertyName, JSType type, Node propertyNode) Defines a property whose type is explicitly declared by the programmer.boolean
EnumType.defineElement
(String name, Node definingNode) Defines a new element on this enum.final boolean
ObjectType.defineInferredProperty
(String propertyName, JSType type, Node propertyNode) Defines a property whose type is inferred.final boolean
ObjectType.defineSynthesizedProperty
(String propertyName, JSType type, Node propertyNode) Defines a property whose type is on a synthesized object.JSTypeRegistry.getReadableTypeName
(Node n) First dereferences the JSType to remove null/undefined then returns a human-readable type nameJSTypeRegistry.getReadableTypeNameNoDeref
(Node n) void
JSTypeRegistry.registerNonLegacyClosureNamespace
(String moduleName, Node definitionNode, JSType type) Registers a goog.module namespace (that does not have goog.module.declareLegacyNamespace)void
JSTypeRegistry.registerTemplateTypeNamesInScope
(Iterable<TemplateType> keys, Node scopeRoot) Registers template types on the given scope root.void
void
ObjectType.setPropertyNode
(String propertyName, Node defSite) Sets the node where the property was defined.void
PrototypeObjectType.setPropertyNode
(String propertyName, Node defSite) The object literal that creates the enum, a reference to another enum, or null.final void
Sets the source node.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