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 NodeNodeUtil.emptyFunction()protected NodeCompiler.ensureLibraryInjected(String resourceName, boolean force) static @Nullable NodeNodeUtil.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 NodeAstManipulations.fuseExpressions(Node exp1, Node exp2) Returns a single node equivalent to executing<expr1, expr2>.static @Nullable NodeNodeUtil.getAssignedValue(Node n) For an assignment or variable declaration get the assigned value.CompilerInput.getAstRoot(AbstractCompiler compiler) static @Nullable NodeNodeUtil.getBestJSDocInfoNode(Node n) Deprecated.because we want to control the input node tokens accepted by this function.static @Nullable NodeNodeUtil.getBestJsDocInfoNodeStrict(Node n) Find the best JSDocInfo node for the given node.static @Nullable NodeNodeUtil.getBestLValue(Node n) Find the l-value that the given r-value is being assigned to.static NodeNodeUtil.getCallTargetResolvingIndirectCalls(Node call) Returns the call target for a call expression, resolving an indirected call (`(0, foo)()`) if present.static NodeNodeUtil.getClassMembers(Node n) @Nullable NodeNodeTraversal.getClosestHoistScopeRoot()@Nullable NodeNodeTraversal.getClosestScopeRootNodeBindingThisOrSuper()Returns the closest scope binding the `this` or `super` keyword@Nullable NodeDestructuredTarget.getComputedProperty()Returns a COMPUTED_PROP node or nullNodeTraversal.getCurrentNode()Returns the node currently being traversed.@Nullable NodeNodeTraversal.getCurrentScript()Returns the SCRIPT node enclosing the current scope@Nullable NodeSymbolTable.Symbol.getDeclarationNode()static NodeNodeUtil.getDeclaringParent(Node targetNode) Returns the node that is effectively declaring the given target.@Nullable NodeDestructuredTarget.getDefaultValue()static NodeNodeUtil.getEnclosingBlock(Node n) Finds the block containing the given node.static NodeNodeUtil.getEnclosingBlockScopeRoot(Node n) static NodeNodeUtil.getEnclosingClass(Node n) Finds the class containing the given node.@Nullable NodeNodeTraversal.getEnclosingFunction()Examines the functions stack for the last instance of a function node.static NodeNodeUtil.getEnclosingFunction(Node n) Finds the function containing the given node.static NodeNodeUtil.getEnclosingHoistScopeRoot(Node n) Return the nearest enclosing hoist scope root node, null for the global scope.static NodeNodeUtil.getEnclosingModuleIfPresent(Node n) static NodeNodeUtil.getEnclosingNode(Node n, com.google.common.base.Predicate<Node> pred) static NodeNodeUtil.getEnclosingScopeRoot(Node n) static NodeNodeUtil.getEnclosingScript(Node n) Finds the script containing the given node.static NodeNodeUtil.getEnclosingStatement(Node n) static NodeNodeUtil.getEnclosingType(Node n, Token type) Gets the closest ancestor to the given node of the provided type.static @Nullable NodeNodeUtil.getEs6ClassConstructorMemberFunctionDef(Node classNode) protected NodeCompiler.getExternsRoot()static NodeNodeUtil.getFunctionBody(Node fn) Return a BLOCK node for the given FUNCTION node.static NodeNodeUtil.getFunctionParameters(Node fnNode) final @Nullable NodeAbstractVar.getInitialValue()protected NodeCompiler.getJsRoot()TypeMismatch.getLocation()static @Nullable NodeNodeUtil.getLoopCodeBlock(Node n) IcuTemplateDefinition.getMessageNode()The RHS node of the message assignment statement.JsMessageDefinition.getMessageNode()The RHS node of the message assignment statement.final NodeAbstractVar.getNameNode()static @Nullable NodeNodeUtil.getNameNode(Node n) Gets the node of a function or class's name.final NodeAbstractVar.getNode()DestructuredTarget.getNode()ImplicitNullabilityCheck.Result.getNode()@Nullable NodeJSError.getNode()Reference.getNode()protected NodeCompiler.getNodeForCodeInsertion(@Nullable JSChunk chunk) final @Nullable NodeAbstractVar.getParentNode()@Nullable NodeJsMessageDefinition.getPlaceholderValuesNode()The object literalNodethat maps placeholder names to expressions providing their values.abstract NodeAbstractCompiler.getRoot()Returns the root node of the AST, which includes both externs and source.Compiler.getRoot()final NodeAbstractScope.getRootNode()Gets the container node of the scope.static NodeNodeUtil.getRootOfQualifiedName(Node qName) Gets the root node of a qualified name.static NodeNodeUtil.getRootTarget(Node targetNode) Returns the outermost target enclosing the given assignment target.static @Nullable NodeNodeUtil.getRValueOfLValue(Node n) Gets the r-value (or initializer) of a node returned by getBestLValue.final NodeAbstractVar.getScopeRoot()@Nullable NodeNodeTraversal.getScopeRoot()Returns the current scope's root.abstract @Nullable NodeAbstractCompiler.getScriptNode(String filename) final @Nullable NodeCompiler.getScriptNode(String filename) @Nullable NodeDestructuredTarget.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 NodeJsMessageVisitor.ObjectLiteralMap.getValueNode(String key) Get the value node for a key.TypeMismatch.location()Returns the value of thelocationrecord component.static NodeNodeUtil.newDeclaration(Node lhs, @Nullable Node rhs, Token declarationType) static NodeNodeUtil.newPropertyAccess(AbstractCompiler compiler, Node context, String name) Creates a property access on thecontexttree.static NodeNodeUtil.newQName(AbstractCompiler compiler, String name) Creates a node representing a qualified name.static NodeNodeUtil.newQNameDeclaration(AbstractCompiler compiler, String name, Node value, JSDocInfo info) Creates a node representing a qualified name.static NodeNodeUtil.newQNameDeclaration(AbstractCompiler compiler, String name, Node value, JSDocInfo info, Token type) Creates a node representing a qualified name.static NodeNodeUtil.newUndefinedNode(Node srcReferenceNode) Create a node for an empty result expression: "void 0"@Nullable NodeJSError.node()Returns the value of thenoderecord component.Compiler.parse(SourceFile file) abstract NodeAbstractCompiler.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 anIterableover 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 voidprotected voidCodeGenerator.add(Node node, CodeGenerator.Context context) protected voidCodeGenerator.add(Node node, CodeGenerator.Context context, boolean printComments) Generate the current nodevoidSourceMap.addMapping(Node node, FilePosition outputStartPosition, FilePosition outputEndPosition) static booleanNodeUtil.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.voidCheckConformance.Rule.check(NodeTraversal t, Node n) Perform conformance checkfinal voidConformanceRules.AbstractRule.check(NodeTraversal t, Node n) protected abstract ConformanceRules.ConformanceResultConformanceRules.AbstractRule.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.BanCreateDom.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.BanCreateElement.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.BanElementSetAttribute.checkConformance(NodeTraversal traversal, Node node) protected ConformanceRules.ConformanceResultConformanceRules.BanExecCommand.checkConformance(NodeTraversal traversal, Node node) protected ConformanceRules.ConformanceResultConformanceRules.BanForOf.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.BanGlobalVars.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.BannedEnhance.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.BannedModsRegex.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.BanNonLiteralArgsToGoogStringConstFrom.checkConformance(NodeTraversal t, Node node) protected ConformanceRules.ConformanceResultConformanceRules.BanNullDeref.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.BanSettingAttributes.checkConformance(NodeTraversal traversal, Node node) protected ConformanceRules.ConformanceResultConformanceRules.BanStaticThis.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.BanThrowOfNonErrorTypes.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.BanUnknownDirectThisPropsReferences.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.BanUnknownThis.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.BanUnknownTypedClassPropsReferences.checkConformance(NodeTraversal t, Node getprop) protected ConformanceRules.ConformanceResultConformanceRules.BanUnresolvedType.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.RequireUseStrict.checkConformance(NodeTraversal t, Node n) protected ConformanceRules.ConformanceResultConformanceRules.StrictBanUnresolvedType.checkConformance(NodeTraversal t, Node n) ConformanceRules.SecuritySensitiveAttributes.checkConformanceForAttributeName(NodeTraversal traversal, Node attrName) Given aNodeTraversalandNode, check if the attribute violates conformance.ConformanceRules.SecuritySensitiveAttributes.checkConformanceForAttributeNameWithHighConfidence(NodeTraversal traversal, Node attrName) Given aNodeTraversalandNode, check if the attribute violates conformance.protected voidChecks a node's type.static com.google.common.collect.ImmutableSet<String> NodeUtil.collectExternVariableNames(AbstractCompiler compiler, Node externs) static intNodeUtil.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 booleanCodingConventions.defaultIsFunctionCallThatAlwaysThrows(Node n, String alwaysThrowsFunctionName) SymbolTable.Symbol.defineReferenceAt(Node n) static voidNodeUtil.deleteChildren(Node n, AbstractCompiler compiler) Permanently delete all the children of the given node, including reporting changes.static voidNodeUtil.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 voidNodeUtil.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.CacheClosureCodingConvention.describeCachingCall(Node node) CodingConvention.describeCachingCall(Node node) Builds aCodingConvention.Cacheinstance from the given call node and returns that instance, or null if theNodedoes not resemble a cache utility call.CodingConventions.Proxy.describeCachingCall(Node node) @Nullable CodingConvention.BindClosureCodingConvention.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) voidClosureCheckModule.enterModule(ModuleMetadataMap.ModuleMetadata currentModule, Node moduleScopeRoot) protected voidNodeTraversal.AbstractModuleCallback.enterModule(ModuleMetadataMap.ModuleMetadata currentModule, Node moduleScopeRoot) Called when the traversal enters a global file or module.static intNodeUtil.estimateNumLines(Node scriptNode) Estimates the number of lines in the file of this script node.voidClosureCheckModule.exitModule(ModuleMetadataMap.ModuleMetadata currentModule, Node moduleScopeRoot) protected voidNodeTraversal.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) booleanClosureCodingConvention.extractIsModuleFile(Node node, Node parent) booleanCodingConvention.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).booleanCodingConventions.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 NodeNodeUtil.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.ProtectedJsMessageReplaceMessages.ProtectedJsMessage.fromAstNode(Node node, JsMessage.IdGenerator idGenerator) static NodeAstManipulations.fuseExpressions(Node exp1, Node exp2) Returns a single node equivalent to executing<expr1, expr2>.static @Nullable NodeNodeUtil.getAssignedValue(Node n) For an assignment or variable declaration get the assigned value.static @Nullable JSDocInfoNodeUtil.getBestJSDocInfo(Node n) Find the best JSDoc for the given node.static @Nullable NodeNodeUtil.getBestJSDocInfoNode(Node n) Deprecated.because we want to control the input node tokens accepted by this function.static @Nullable NodeNodeUtil.getBestJsDocInfoNodeStrict(Node n) Find the best JSDocInfo node for the given node.static @Nullable NodeNodeUtil.getBestLValue(Node n) Find the l-value that the given r-value is being assigned to.static @Nullable StringNodeUtil.getBestLValueName(@Nullable Node lValue) Get the name of the given l-value node.static NodeNodeUtil.getCallTargetResolvingIndirectCalls(Node call) Returns the call target for a call expression, resolving an indirected call (`(0, foo)()`) if present.@Nullable CodingConvention.SubclassRelationshipClosureCodingConvention.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 NodeNodeUtil.getClassMembers(Node n) ProcessCommonJSModules.getCommonJsImportPath(Node requireCall) static StringProcessCommonJSModules.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 intNodeUtil.getCount(Node n, com.google.common.base.Predicate<Node> pred, com.google.common.base.Predicate<Node> traverseChildrenPred) static @Nullable JSTypeExpressionNodeUtil.getDeclaredTypeExpression(Node declaration) Return declared JSDoc type for the given name declaration, or null if none present.static NodeNodeUtil.getDeclaringParent(Node targetNode) Returns the node that is effectively declaring the given target.static NodeNodeUtil.getEnclosingBlock(Node n) Finds the block containing the given node.static NodeNodeUtil.getEnclosingBlockScopeRoot(Node n) static NodeNodeUtil.getEnclosingClass(Node n) Finds the class containing the given node.static NodeNodeUtil.getEnclosingFunction(Node n) Finds the function containing the given node.SymbolTable.getEnclosingFunctionScope(Node n) Gets the scope that contains the given node.static NodeNodeUtil.getEnclosingHoistScopeRoot(Node n) Return the nearest enclosing hoist scope root node, null for the global scope.static NodeNodeUtil.getEnclosingModuleIfPresent(Node n) static NodeNodeUtil.getEnclosingNode(Node n, com.google.common.base.Predicate<Node> pred) @Nullable SymbolTable.SymbolScopeSymbolTable.getEnclosingScope(Node n) Gets the scope that contains the given node.static NodeNodeUtil.getEnclosingScopeRoot(Node n) static NodeNodeUtil.getEnclosingScript(Node n) Finds the script containing the given node.static NodeNodeUtil.getEnclosingStatement(Node n) static NodeNodeUtil.getEnclosingType(Node n, Token type) Gets the closest ancestor to the given node of the provided type.static @Nullable NodeNodeUtil.getEs6ClassConstructorMemberFunctionDef(Node classNode) static NodeNodeUtil.getFunctionBody(Node fn) Return a BLOCK node for the given FUNCTION node.static NodeNodeUtil.getFunctionParameters(Node fnNode) static @Nullable NodeUtil.GoogRequireNodeUtil.getGoogRequireInfo(Node nameNode) static @Nullable InputIdNodeUtil.getInputId(Node n) static NodeUtil.ValueTypeNodeUtil.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 NodeNodeUtil.getLoopCodeBlock(Node n) static @Nullable Stringstatic @Nullable NodeNodeUtil.getNameNode(Node n) Gets the node of a function or class's name.static @Nullable StringNodeUtil.getNearestFunctionName(Node n) Gets the function's name.@Nullable CodingConvention.ObjectLiteralCastClosureCodingConvention.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 voidNodeUtil.getParamOrPatternNames(Node n, Consumer<Node> cb) Callscbwith all NAMEs declared in a PARAM_LIST or destructuring pattern.static NodeNodeUtil.getRootOfQualifiedName(Node qName) Gets the root node of a qualified name.static NodeNodeUtil.getRootTarget(Node targetNode) Returns the outermost target enclosing the given assignment target.static @Nullable NodeNodeUtil.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 StaticSourceFileNodeUtil.getSourceFile(Node n) static StringNodeUtil.getSourceName(Node n) static @Nullable StringNodeUtil.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) voidAstValidator.ViolationHandler.handleViolation(String message, Node n) static booleanNodeUtil.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 booleanstatic booleanNodeUtil.isAssignmentOp(Node n) Returns true if the operator is an assignment type operator.static booleanNodeUtil.isBigIntResult(Node n) Returns true if the result of node evaluation is always a bigintstatic booleanNodeUtil.isBlocklessArrowFunctionResult(Node n) static booleanNodeUtil.isBooleanResult(Node n) static booleanControlFlowAnalysis.isBreakTarget(Node target, String label) Checks if target is actually the break target of labeled continue.static booleanNodeUtil.isCallOrNew(Node node) static booleanA faster version ofNodeUtil.isCallTo(Node, String).static booleanNodeUtil.isCallTo(Node n, QualifiedName qualifiedName) static booleanstatic booleanNodeUtil.isClassDeclaration(Node n) Is this a class declaration.booleanCodingConvention.isClassFactoryCall(Node callNode) Checks if the given method is a call to a class factory, such a factory returns a unique class.booleanCodingConventions.Proxy.isClassFactoryCall(Node callNode) booleanGoogleCodingConvention.isClassFactoryCall(Node callNode) static booleanProcessCommonJSModules.isCommonJsDynamicImportCallback(Node n, ModuleLoader.ResolutionMode resolutionMode) Recognize if a node is a dynamic module import.static booleanProcessCommonJSModules.isCommonJsExport(NodeTraversal t, Node export, ModuleLoader.ResolutionMode resolutionMode) Recognize if a node is a module export.booleanProcessCommonJSModules.isCommonJsImport(Node requireCall) static booleanProcessCommonJSModules.isCommonJsImport(Node requireCall, ModuleLoader.ResolutionMode resolutionMode) Recognize if a node is a module import.static booleanNodeUtil.isCompoundAssignmentOp(Node n) static booleanNodeUtil.isControlStructure(Node n) Determines whether the given node is a FOR, DO, WHILE, WITH, or IF node.static booleanNodeUtil.isDeclarationLValue(Node n) Determines whether this node is used as an L-value that is a declaration.static booleanNodeUtil.isEmptyBlock(Node block) Returns whether this a BLOCK node with no children.static booleanNodeUtil.isEnhancedFor(Node n) static booleanControlFlowGraph.isEnteringNewCfgNode(Node n) static booleanNodeUtil.isEs6Constructor(Node fnNode) static booleanNodeUtil.isEs6ConstructorMemberFunctionDef(Node memberFunctionDef) static booleanEs6RewriteModules.isEs6ModuleRoot(Node scriptNode) Return whether or not the given script node represents an ES6 module file.static booleanNodeUtil.isExprCall(Node n) Is this node a call expression statement?static booleanNodeUtil.isExpressionResultUsed(Node expr) static booleanNodeUtil.isFromTypeSummary(Node n) Determine if the given SCRIPT is a @typeSummary file, like an i.js filebooleanClosureCodingConvention.isFunctionCallThatAlwaysThrows(Node n) booleanCodingConvention.isFunctionCallThatAlwaysThrows(Node n) Used by CheckMissingReturn.booleanCodingConventions.Proxy.isFunctionCallThatAlwaysThrows(Node n) static booleanNodeUtil.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 booleanNodeUtil.isGoogModuleCall(Node n) static booleanNodeUtil.isGoogProvideCall(Node n) static booleanNodeUtil.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 booleanNodeUtil.isHoistScopeRoot(Node n) static booleanNodeUtil.isImportedName(Node n) static booleanNodeUtil.isInFunction(Node n) static booleanNodeUtil.isLhsByDestructuring(Node n) Returns true if the node is a lhs value of a destructuring assignment.static booleanNodeUtil.isLhsOfAssign(Node n) static booleanNodeUtil.isLiteralValue(Node n, boolean includeFunctions) Returns true if this is a literal value.static booleanNodeUtil.isLogicalAssignmentOp(Node n) Returns true if the operator is a logical assignment type operator.static booleanNodeUtil.isLoopStructure(Node n) Determines whether the given node is a FOR, DO, or WHILE node.static booleanDetermines whether this node is used as an L-value.static booleanNodeUtil.isMethodDeclaration(Node n) Is this node a class or object literal member function?static booleanNodeUtil.isNameDeclaration(Node n) Is this node a name declaration?static booleanNodeUtil.isNameDeclOrSimpleAssignLhs(Node n, Node parent) Determines whether this node is strictly on the left hand side of an assign or var initialization.static booleanNodeUtil.isNamedExportsLiteral(Node objectLiteral) Whether this is an assignment to 'exports' that creates named exports.static booleanNodeUtil.isNamespaceDecl(Node n) Returns true iff this node defines a namespace, e.g.,static booleanNodeUtil.isNormalGet(Node n) Is this a GETPROP or GETELEM node?static booleanNodeUtil.isNormalOrOptChainCall(Node n) Is this a CALL or OPTCHAIN_CALL?static booleanNodeUtil.isNormalOrOptChainGet(Node n) Is this a GETPROP, OPTCHAIN_GETPROP, GETELEM, or OPTCHAIN_GETELEM?static booleanNodeUtil.isNormalOrOptChainGetProp(Node n) Is this a GETPROP or OPTCHAIN_GETPROP?static booleanNodeUtil.isNullOrUndefined(Node n) static booleanNodeUtil.isNumericResult(Node n) Returns true if the result of node evaluation is always a numberstatic booleanNodeUtil.isObjectDefinePropertiesDefinition(Node n) Returnstrueif the node is a definition with Object.definePropertiesstatic booleanNodeUtil.isObjectResult(Node n) static booleanNodeUtil.isObjLitProperty(Node node) Returns true if the node is a property of an object literal.static booleanNodeUtil.isOptChainGet(Node n) Is this an OPTCHAIN_GETPROP or OPTCHAIN_GETELEM node?static booleanNodeUtil.isOptChainNode(Node n) Is this a OPTCHAIN_GETPROP, OPTCHAIN_GETELEM, OPTCHAIN_CALL node?booleanCodingConvention.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.booleanCodingConventions.Proxy.isOptionalParameter(Node parameter) booleanGoogleCodingConvention.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.booleanClosureCodingConvention.isPropertyRenameFunction(Node nameNode) booleanCodingConvention.isPropertyRenameFunction(Node nameNode) Whether this GETPROP or NAME node is the function is returning the string name for a property, but allows renaming.booleanCodingConventions.Proxy.isPropertyRenameFunction(Node nameNode) booleanClosureCodingConvention.isPropertyTestFunction(Node call) booleanCodingConvention.isPropertyTestFunction(Node call) Whether this CALL function is testing for the existence of a property.booleanCodingConventions.Proxy.isPropertyTestFunction(Node call) booleanCodingConvention.isPrototypeAlias(Node getProp) Whether this GETPROP node is an alias for an object prototype.booleanCodingConventions.Proxy.isPrototypeAlias(Node getProp) static booleanNodeUtil.isPrototypePropertyDeclaration(Node n) static booleanNodeUtil.isShallowStatementTree(Node n) Whether the given node's subtree may contain statements, excepting nested functionsstatic booleanNodeUtil.isStatement(Node n) static booleanNodeUtil.isStatementBlock(Node n) static booleanNodeUtil.isStatementParent(Node parent) static booleanSourceInformationAnnotator.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 booleanNodeUtil.isStringResult(Node n) static booleanNodeUtil.isTopLevel(Node n) static booleanNodeUtil.isUndefined(Node n) booleanCodingConvention.isVarArgsParameter(Node parameter) This checks whether a given parameter should be treated as a marker for a variable argument list function.booleanCodingConventions.Proxy.isVarArgsParameter(Node parameter) booleanGoogleCodingConvention.isVarArgsParameter(Node parameter) static JSErrorJSError.make(com.google.javascript.jscomp.Requirement requirement, Node n, DiagnosticType type, String... arguments) Creates a JSError from a requirement, file and Node position.static JSErrorJSError.make(Node n, DiagnosticType type, String... arguments) Creates a JSError from a file and Node position.static JSErrorJSError.make(Node start, Node end, DiagnosticType type, String... arguments) Creates a JSError from a file and Node position.static voidNodeUtil.markFunctionsDeleted(Node node, AbstractCompiler compiler) Recurses through a tree, marking all function nodes deleted.booleanbooleanAstAnalyzer.mayHaveSideEffects(Node n) Returns true if the node which may have side effects when executed.static booleanControlFlowAnalysis.mayThrowException(Node n) Determines if the subtree might throw an exception.static NodeNodeUtil.newDeclaration(Node lhs, @Nullable Node rhs, Token declarationType) static NodeNodeUtil.newPropertyAccess(AbstractCompiler compiler, Node context, String name) Creates a property access on thecontexttree.static NodeNodeUtil.newQNameDeclaration(AbstractCompiler compiler, String name, Node value, JSDocInfo info) Creates a node representing a qualified name.static NodeNodeUtil.newQNameDeclaration(AbstractCompiler compiler, String name, Node value, JSDocInfo info, Token type) Creates a node representing a qualified name.static NodeNodeUtil.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 anIterableover the given node and all descendents.protected voidCodeGenerator.printLeadingCommentsInOrder(Node node) Print Leading JSDocComments or NonJSDocComments for the given node in order, depending on their source location.protected voidCodeGenerator.printTrailingComment(Node node) voidvoidvoidvoidvoidvoidvoidProcess the JS with root node root.voidvoidvoidvoidConvenience method for running this pass over a tree with this class as a callback.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidConvenience method for running this pass over a tree with this class as a callback.voidvoidvoidvoidvoidvoidvoidModule rewriting is done a on per-file basis prior to main compilation.voidvoidvoidvoidvoidMain entry point for this phase of processing.voidTypeCheck.processForTesting(Node externsRoot, Node jsRoot) Main entry point of this phase for testing code.static voidNodeUtil.removeChild(Node parent, Node node) Safely remove children while maintaining a valid node structure.static voidNodeUtil.removeName(Node n) Set the given function/class node to an empty namestatic voidNodeUtil.replaceDeclarationChild(Node declChild, Node newStatement) Replace the child of a var/let/const declaration (usually a name) with a new statement.protected voidConformanceRules.AbstractRule.report(Node n, ConformanceRules.ConformanceResult result) Report a conformance warning for the given node.voidNodeTraversal.report(Node n, DiagnosticType diagnosticType, String... arguments) Reports a diagnostic (error or warning)voidNodeTraversal.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 voidAbstractCompiler.reportChangeToChangeScope(Node changeScopeRoot) Mark modifications in a scope that is different than the Compiler.currentScope use this (eg, InlineVariables and many others)voidCompiler.reportChangeToChangeScope(Node changeScopeRoot) abstract voidAbstractCompiler.reportChangeToEnclosingScope(Node n) Passes that make modifications in a scope that is different than the Compiler.currentScope use this (eg, InlineVariables and many others)voidCompiler.reportChangeToEnclosingScope(Node n) voidNodeTraversal.reportCodeChange(Node n) voidCompiler.reportFunctionDeleted(Node n) ControlFlowAnalysis.Builder.setCfgRoot(Node cfgRoot) booleanCheckConformance.Precondition.shouldCheck(Node n) final booleanCheckConformance.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanCheckMissingRequires.shouldTraverse(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, Node scopeRoot) booleanControlFlowAnalysis.shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) final booleanControlFlowGraph.AbstractCfgNodeTraversalCallback.shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) booleanCrossChunkReferenceCollector.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanEs6ConvertSuperConstructorCalls.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanEs6RenameVariablesInParamLists.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanEs6RewriteArrowFunction.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanEs6RewriteClass.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanEs6RewriteClassExtendsExpressions.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanEs6RewriteDestructuring.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanEs6RewriteModules.shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) booleanEs6RewriteScriptsToModules.shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) booleanEs7RewriteExponentialOperator.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanExtraRequireRemover.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanFindModuleDependencies.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanForbidDynamicImportUsage.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanInstrumentAsyncContext.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanLateEs6ToEs3Converter.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanNodeTraversal.AbstractCfgCallback.shouldTraverse(NodeTraversal t, Node n, Node parent) final booleanNodeTraversal.AbstractChangedScopeCallback.shouldTraverse(NodeTraversal t, Node n, Node parent) protected booleanNodeTraversal.AbstractModuleCallback.shouldTraverse(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, @Nullable Node moduleScopeRoot) final booleanNodeTraversal.AbstractModuleCallback.shouldTraverse(NodeTraversal t, Node n, Node parent) final booleanNodeTraversal.AbstractPostOrderCallback.shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) final booleanNodeTraversal.AbstractScopedCallback.shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) final booleanNodeTraversal.AbstractShallowCallback.shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) final booleanNodeTraversal.AbstractShallowStatementCallback.shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) booleanNodeTraversal.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 booleanNodeTraversal.ExternsSkippingCallback.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanProcessCommonJSModules.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanRewriteAsyncFunctions.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanRewriteAsyncIteration.shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) booleanRewriteClassMembers.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanRewriteLogicalAssignmentOperatorsPass.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanRewriteNullishCoalesceOperator.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanRewriteObjectSpread.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanTypeCheck.shouldTraverse(NodeTraversal t, Node n, Node parent) protected booleanCompiler.ScriptNodeLicensesOnlyTracker.shouldUseLicenseInfo(Node node) protected booleanCompiler.SingleBinaryLicenseTracker.shouldUseLicenseInfo(Node node) voidEs6SplitVariableDeclarations.splitDeclaration(NodeTraversal t, Node n, Node parent) static StringConverts an AST to dot representation.abstract StringPrints a node to source code.voidCompiler.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.voidCodePrinter.LicenseTracker.trackLicensesForNode(Node node) voidCompiler.ChunkGraphAwareLicenseTracker.trackLicensesForNode(Node node) voidstatic voidNodeTraversal.traverse(AbstractCompiler compiler, Node root, NodeTraversal.Callback cb) Traverses using the SyntacticScopeCreatorstatic voidNodeTraversal.traverseRoots(AbstractCompiler compiler, NodeTraversal.Callback cb, Node externs, Node root) static voidNodeTraversal.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 booleanNodeUtil.tryMergeBlock(Node block, boolean ignoreBlockScopedDeclarations) Merge a block with its parent block.static voidGatherGetterAndSetterProperties.update(AbstractCompiler compiler, Node externs, Node root) Gathers all getters and setters in the AST.voidAstValidator.validateCodeRoot(Node n) voidAstValidator.validateExpression(Node n) voidAstValidator.validateModuleContents(Node n) voidAstValidator.validateRoot(Node n) voidAstValidator.validateScript(Node n) voidAstValidator.validateStatement(Node n) voidAstValidator.validateStatement(Node n, boolean isAmbient) Validates a statement node and its children.voidAstValidator.validateStatements(Node n) voidCheckConformance.visit(NodeTraversal t, Node n, Node parent) voidCheckMissingRequires.visit(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, @Nullable Node scopeRoot) voidCheckTypeImportCodeReferences.visit(NodeTraversal t, Node n, Node parent) voidChromePass.visit(NodeTraversal t, Node node, Node parent) protected voidClosureCheckModule.visit(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, @Nullable Node moduleScopeRoot) voidControlFlowAnalysis.visit(NodeTraversal t, Node n, Node parent) voidCrossChunkReferenceCollector.visit(NodeTraversal t, Node n, Node parent) For each node, update the block stack and reference collection as appropriate.voidEs6CheckModule.visit(NodeTraversal t, Node n, Node parent) voidEs6ConvertSuper.visit(NodeTraversal t, Node n, Node parent) voidEs6ConvertSuperConstructorCalls.visit(NodeTraversal t, Node n, Node parent) voidEs6ExtractClasses.visit(NodeTraversal t, Node n, Node parent) voidEs6ForOfConverter.visit(NodeTraversal t, Node n, Node parent) voidEs6RenameVariablesInParamLists.visit(NodeTraversal t, Node block, Node function) voidEs6RewriteArrowFunction.visit(NodeTraversal t, Node n, Node parent) voidEs6RewriteBlockScopedDeclaration.visit(NodeTraversal t, Node n, Node parent) voidEs6RewriteBlockScopedFunctionDeclaration.visit(NodeTraversal t, Node n, Node parent) voidEs6RewriteClass.visit(NodeTraversal t, Node n, Node parent) voidEs6RewriteClassExtendsExpressions.visit(NodeTraversal t, Node n, Node parent) voidEs6RewriteDestructuring.visit(NodeTraversal t, Node n, Node parent) voidEs6RewriteModules.visit(NodeTraversal t, Node n, Node parent) voidEs6RewriteRestAndSpread.visit(NodeTraversal traversal, Node current, Node parent) voidEs6SplitVariableDeclarations.visit(NodeTraversal t, Node n, Node parent) voidEs7RewriteExponentialOperator.visit(NodeTraversal t, Node n, Node parent) voidExtraRequireRemover.visit(NodeTraversal t, Node n, Node parent) Visits each corresponding node and tracks all goog.requires as well as their usagesvoidFindModuleDependencies.visit(NodeTraversal t, Node n, Node parent) voidForbidDynamicImportUsage.visit(NodeTraversal t, Node n, Node parent) voidImplicitNullabilityCheck.visit(NodeTraversal t, Node n, Node p) Crawls the JSDoc of the given node to find any names in JSDoc that are implicitly null.voidInjectTranspilationRuntimeLibraries.visit(NodeTraversal t, Node n, Node parent) voidInstrumentAsyncContext.visit(NodeTraversal t, Node n, @Nullable Node parent) voidJ2clAssertRemovalPass.visit(NodeTraversal t, Node node, Node parent) voidJ2clChecksPass.visit(NodeTraversal unused, Node n, Node parent) voidJ2clUtilGetDefineRewriterPass.visit(NodeTraversal t, Node n, Node parent) voidJsMessageVisitor.visit(NodeTraversal traversal, Node node, Node unused) voidLateEs6ToEs3Converter.visit(NodeTraversal t, Node n, Node parent) voidNodeTraversal.AbstractCfgCallback.visit(NodeTraversal t, Node n, Node parent) protected voidNodeTraversal.AbstractModuleCallback.visit(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, @Nullable Node moduleScopeRoot) final voidNodeTraversal.AbstractModuleCallback.visit(NodeTraversal t, Node n, Node parent) voidNodeTraversal.AbstractPostOrderCallbackInterface.visit(NodeTraversal t, Node n, Node parent) final voidNodeTraversal.AbstractPreOrderCallback.visit(NodeTraversal t, Node n, Node parent) voidNodeTraversal.Callback.visit(NodeTraversal t, Node n, @Nullable Node parent) Visits a node in postorder (after its children).voidvoidRewriteAsyncFunctions.visit(NodeTraversal t, Node n, Node parent) voidRewriteAsyncIteration.visit(NodeTraversal t, Node n, Node parent) voidRewriteClassMembers.visit(NodeTraversal t, Node n, Node parent) voidRewriteDynamicImports.visit(NodeTraversal t, Node n, Node parent) voidRewriteJsonToModule.visit(NodeTraversal t, Node n, Node parent) voidRewriteLogicalAssignmentOperatorsPass.visit(NodeTraversal t, Node logicalAssignment, Node parent) voidRewriteNullishCoalesceOperator.visit(NodeTraversal t, Node n, Node parent) voidRewriteObjectSpread.visit(NodeTraversal t, Node n, Node parent) voidSourceInformationAnnotator.visit(NodeTraversal t, Node n, Node parent) voidTypeCheck.visit(NodeTraversal t, Node n, Node parent) This is the meat of the type checking.static voidNodeUtil.visitLhsNodesInDestructuringPattern(Node destructuringPattern, Consumer<Node> consumer) Retrieves lhs nodes declared or assigned in a given destructuring pattern node.static voidNodeUtil.visitLhsNodesInNode(Node assigningParent, Consumer<Node> consumer) Retrieves lhs nodes declared or assigned in a given assigning parent node.static voidNodeUtil.visitPostOrder(Node node, NodeUtil.Visitor visitor) A post-order traversal, calling Visitor.visit for each decendent.static voidNodeUtil.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 voidNodeUtil.visitPreOrder(Node node, NodeUtil.Visitor visitor) A pre-order traversal, calling Visitor.visit for each decendent.static voidNodeUtil.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 NodeNodeUtil.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 intNodeUtil.getCount(Node n, com.google.common.base.Predicate<Node> pred, com.google.common.base.Predicate<Node> traverseChildrenPred) static NodeNodeUtil.getEnclosingNode(Node n, com.google.common.base.Predicate<Node> pred) static voidNodeUtil.getParamOrPatternNames(Node n, Consumer<Node> cb) Callscbwith 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 booleanNodeUtil.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 anIterableover 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 voidNodeTraversal.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 voidNodeUtil.visitLhsNodesInDestructuringPattern(Node destructuringPattern, Consumer<Node> consumer) Retrieves lhs nodes declared or assigned in a given destructuring pattern node.static voidNodeUtil.visitLhsNodesInNode(Node assigningParent, Consumer<Node> consumer) Retrieves lhs nodes declared or assigned in a given assigning parent node.static voidNodeUtil.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 voidNodeUtil.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.JSError(DiagnosticType type, String description, @Nullable String sourceName, int lineno, int charno, int length, @Nullable Node node, CheckLevel defaultLevel, @Nullable com.google.javascript.jscomp.Requirement requirement) Creates an instance of aJSErrorrecord class.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.TypeMismatch(JSType found, JSType required, Node location) Creates an instance of aTypeMismatchrecord class. -
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 TypeMethodDescriptionbooleanCheckArrayWithGoogObject.isGoogObjectIterationOverArray(Node n) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidbooleanCheckConstantCaseNames.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanCheckEs6ModuleFileStructure.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanCheckEs6Modules.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanCheckGoogModuleTypeScriptName.shouldTraverse(NodeTraversal t, Node n, Node parent) final booleanCheckNestedNames.shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) booleanCheckNoMutatedEs6Exports.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanCheckPrototypeProperties.shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) booleanCheckProvidesSorted.shouldTraverse(NodeTraversal t, Node n, Node parent) final booleanCheckRequiresSorted.shouldTraverse(NodeTraversal t, Node n, Node parent) final booleanCheckUnusedLabels.shouldTraverse(NodeTraversal t, Node n, Node parent) booleanCheckUnusedPrivateProperties.shouldTraverse(NodeTraversal t, Node n, Node parent) final booleanCheckUselessBlocks.shouldTraverse(NodeTraversal t, Node n, Node parent) voidCheckArrayWithGoogObject.visit(NodeTraversal unused, Node n, Node parent) voidCheckConstantCaseNames.visit(NodeTraversal t, Node n, Node parent) voidCheckConstPrivateProperties.visit(NodeTraversal t, Node n, Node parent) voidCheckDuplicateCase.visit(NodeTraversal t, Node n, Node parent) voidCheckEmptyStatements.visit(NodeTraversal t, Node n, Node parent) voidCheckEnums.visit(NodeTraversal t, Node n, Node parent) voidCheckEs6Modules.visit(NodeTraversal t, Node n, Node parent) voidCheckExtraRequires.visit(NodeTraversal t, Node n, Node parent) voidCheckGoogModuleTypeScriptName.visit(NodeTraversal t, Node n, Node parent) voidCheckInterfaces.visit(NodeTraversal t, Node n, Node parent) voidCheckJSDocStyle.visit(NodeTraversal t, Node n, Node unused) voidCheckMissingSemicolon.visit(NodeTraversal t, Node n, Node parent) voidCheckNestedNames.visit(NodeTraversal t, Node n, Node parent) voidCheckNoMutatedEs6Exports.visit(NodeTraversal t, Node n, Node parent) voidCheckNullabilityModifiers.visit(NodeTraversal t, Node n, Node parent) voidCheckPrimitiveAsObject.visit(NodeTraversal t, Node n, Node parent) voidCheckPrototypeProperties.visit(NodeTraversal unused, Node n, Node parent) voidCheckProvidesSorted.visit(NodeTraversal t, Node n, Node parent) final voidCheckRequiresSorted.visit(NodeTraversal t, Node n, Node parent) voidCheckUnusedLabels.visit(NodeTraversal t, Node n, Node parent) voidCheckUnusedPrivateProperties.visit(NodeTraversal t, Node n, Node parent) voidCheckUselessBlocks.visit(NodeTraversal t, Node n, Node parent) voidCheckVar.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 NodeExport.exportNode()Node that this export originates from.abstract NodeImport.importNode()Returns the import node for source information.abstract @Nullable NodeExport.nameNode()Node that this export originates from.abstract NodeImport.nameNode()Returns the name node for source information.abstract @Nullable NodeModuleMetadataMap.ModuleMetadata.rootNode()AST node that represents the root of this module.@Nullable NodeBinding.sourceNode()Returns the value of thesourceNoderecord component.Methods in com.google.javascript.jscomp.modules with parameters of type NodeModifier and TypeMethodDescriptioncom.google.javascript.jscomp.modules.UnresolvedModuleEsModuleProcessor.process(ModuleMetadataMap.ModuleMetadata metadata, ModuleLoader.ModulePath path, Node script) voidbooleanEsModuleProcessor.shouldTraverse(NodeTraversal t, Node n, Node parent) voidEsModuleProcessor.visit(NodeTraversal t, Node n, Node parent) Constructors in com.google.javascript.jscomp.modules with parameters of type NodeModifierConstructorDescriptionBinding(ModuleMetadataMap.ModuleMetadata metadata, @Nullable Node sourceNode, @Nullable Export originatingExport, boolean isModuleNamespace, @Nullable String closureNamespace, com.google.javascript.jscomp.modules.Binding.CreatedBy createdBy) Creates an instance of aBindingrecord class. -
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 NodeJsDocInfoParser.parseTypeString(String typeString) Parses a string containing a JsDoc type declaration, returning the type if the parsing succeeded ornullif it failed.Methods in com.google.javascript.jscomp.parsing with parameters of type NodeModifier and TypeMethodDescriptionstatic voidParsingUtil.getParamOrPatternNames(Node n, Consumer<Node> cb) Callscbwith 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 voidParsingUtil.getParamOrPatternNames(Node n, Consumer<Node> cb) Callscbwith 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 FlowScopeChainableReverseAbstractInterpreter.declareNameInScope(FlowScope scope, Node node, JSType type) Declares a refined type inscopefor the name represented bynode.protected FlowScopeChainableReverseAbstractInterpreter.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 JSTypeChainableReverseAbstractInterpreter.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 givensymbolupdated toinferredType.protected FlowScopeChainableReverseAbstractInterpreter.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 ScriptMetadataScriptMetadata.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 booleanRefactoringUtils.isInClosurizedFile(Node node, NodeMetadata metadata) Looks for a goog.require(), goog.provide() or goog.module() call in the node's file.booleanJsSourceMatcher.matches(Node n, NodeMetadata metadata) booleanMatcher.matches(Node n, NodeMetadata metadata) Returns true if the specifiedNodeandNodeMetadatamatch the given pattern.abstract booleanScanner.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 TypeMethodDescriptionbooleanGoogBindToArrow.matches(Node node, NodeMetadata metadata) -
Uses of Node in com.google.javascript.rhino
Methods in com.google.javascript.rhino that return NodeModifier and TypeMethodDescriptionstatic Nodestatic Nodestatic NodeTypeDeclarationsIR.anyType()Equivalent to the UNKNOWN type in Closure, expressed with{?}static Nodestatic Nodestatic NodeIR.arrayPattern(Node... keys) static NodeRepresents an array type.static NodeIR.arrowFunction(Node name, Node params, Node body) static Nodestatic Node"invalid input: '&'invalid input: '&'="static NodeIR.assignCoalesce(Node expr1, Node expr2) "??="static Node"||="static Nodestatic NodeIR.bigint(BigInteger b) static NodeIR.bitwiseAnd(Node expr1, Node expr2) "invalid input: '&'"static NodeIR.block()static Nodestatic Nodestatic Nodestatic NodeTypeDeclarationsIR.booleanType()static NodeIR.breakNode()static Nodestatic Nodestatic Nodestatic Nodestatic Nodefinal NodeNode.cloneNode()Returns a detached clone of the Node, specifically excluding its children.final NodeNode.clonePropsFrom(Node other) Clone the properties from the provided node without copying the property object.final NodeNode.cloneTree()Returns a detached clone of the Node and all its children.final NodeNode.cloneTree(boolean cloneTypeExprs) static Nodestatic Nodestatic NodeIR.computedProp(Node key, Node value) static Nodestatic NodeIR.continueNode()static NodeIR.continueNode(Node name) static NodeIR.continueOptChainCall(Node target, Node... args) static NodeIR.continueOptChainGetelem(Node target, Node elem) static NodeIR.continueOptChainGetprop(Node target, String prop) final NodeNode.copyTypeFrom(Node other) Copies a nodes JSType or Color (if present)static Nodestatic NodeIR.declaration(Node lhs, Node value, Token type) static NodeIR.declaration(Node lhs, Token type) static NodeIR.defaultCase(Node body) static Nodefinal NodeNode.detach()Removes this node from its parent, but retains its subtree.static Nodestatic NodeIR.empty()static Node"=="static Nodestatic NodeIR.exprResult(Node expr) static NodeIR.falseNode()static Nodestatic Nodestatic Nodestatic NodeTypeDeclarationsIR.functionType(Node returnType, LinkedHashMap<String, Node> requiredParams, LinkedHashMap<String, Node> optionalParams, String restName, Node restType) Represents a function type.static Node">="final @Nullable NodeNode.getAncestor(int level) Gets the ancestor node relative to this.final NodeNode.getChildAtIndex(int i) Gets the ith child, note that this is O(N) where N is the number of children.final @Nullable NodeNode.getClosureUnawareShadow()final @Nullable NodeNode.getDeclaredTypeExpression()Returns the syntactical type specified on this node.static Nodefinal @Nullable NodeNode.getFirstChild()final @Nullable NodeNode.getFirstFirstChild()Get the first child of the first child.final @Nullable NodeNode.getGrandparent()final @Nullable NodeNode.getLastChild()final @Nullable NodeNode.getNext()StaticRef.getNode()The node where the reference lives.final NodeNode.getOnlyChild()final @Nullable NodeNode.getParent()final @Nullable NodeNode.getPrevious()static Nodestatic NodeJSTypeExpression.getRoot()StaticScope.getRootNode()Returns the root node associated with this scope.final @Nullable NodeNode.getSecondChild()static Nodestatic Nodestatic Nodestatic Nodestatic NodeIR.importMeta()static NodeIR.importNode(Node name, Node importSpecs, Node moduleIdentifier) static NodeIR.importStar(String name) static Nodestatic Nodestatic Nodestatic NodeIR.iterSpread(Node expr) static Nodestatic Nodestatic Nodestatic Nodestatic Node"<"static NodeIR.memberFieldDef(String name, Node value) static NodeIR.memberFunctionDef(String name, Node function) static Nodestatic NodeProduces a tree structure similar to the Rhino AST of a qualified name expression, under a top-level NAMED_TYPE node.static NodeSplits a '.' separated qualified name into a tree of type segments.static Node"!="static Nodestatic NodeNode.newBigInt(BigInteger bigint) static Nodestatic NodeNode.newNumber(double number) static NodeNode.newString(Token token, RhinoStringPool.LazyInternedStringList stringPool, int offset) static Nodestatic Nodestatic NodeNode.newTemplateLitString(RhinoStringPool.LazyInternedStringList stringPool, int cookedOffsetOrNegativeOne, int rawOffset) static NodeNode.newTemplateLitString(String cooked, String raw) static Nodestatic NodeIR.nullNode()static NodeIR.number(double d) static NodeTypeDeclarationsIR.numberType()static Nodestatic NodeIR.objectPattern(Node... keys) static NodeIR.objectRest(Node target) static NodeIR.objectSpread(Node expr) static NodeTypeDeclarationsIR.optionalParameter(Node parameterType) Represents a function parameter that is optional.static Nodestatic NodeTypeDeclarationsIR.parameterizedType(Node baseType, Iterable<Node> typeParameters) Represents a parameterized, or generic, type.static Nodestatic Nodestatic Nodestatic NodeIR.quotedStringKey(String s, Node value) static NodeTypeDeclarationsIR.recordType(LinkedHashMap<String, Node> properties) Represents a structural type.static Nodestatic Nodefinal @Nullable NodeNode.removeChildren()Remove all children, but leave them linked to each other.final @Nullable NodeNode.removeFirstChild()Removes the first child of Node.static NodeIR.returnNode()static NodeIR.returnNode(Node expr) static NodeIR.rightShift(Node expr1, Node expr2) ">>"static Nodestatic NodeIR.script()static Nodestatic Nodefinal Nodefinal NodeNode.setJSDocInfo(JSDocInfo info) Sets theJSDocInfoattached to this node.final Nodefinal NodeNode.setLinenoCharno(int lineno, int charno) Merges the line number and character number in one integer.final NodeNode.setNonJSDocComment(NonJSDocComment comment) Sets the NonJSDoc comment attached to this node.final NodeNode.setStaticSourceFile(@Nullable StaticSourceFile file) static Nodefinal NodeNode.setTrailingNonJSDocComment(NonJSDocComment comment) static Node"==="static Node"!=="final NodeCopy the source info from `other` onto `this`.final NodeNode.srcrefIfMissing(Node other) Iff source info is not set on `this`, copy the source info from `other`.final NodeNode.srcrefTree(Node other) For all Nodes in the subtree of `this`, copy the source info from `other`.final NodeNode.srcrefTreeIfMissing(Node other) For all Nodes in the subtree of `this`, iff source info is not set, copy the source info from `other`.static NodeIR.startOptChainCall(Node target, Node... args) static NodeIR.startOptChainGetelem(Node target, Node elem) static NodeIR.startOptChainGetprop(Node target, String prop) static Nodestatic Nodestatic Nodestatic NodeTypeDeclarationsIR.stringType()static Nodestatic NodeIR.superNode()static NodeIR.switchNode(Node cond, Node... cases) static NodeIR.templateLiteral()static NodeIR.templateLiteralString(@Nullable String cooked, String raw) static NodeIR.templateLiteralSubstitution(Node child) static NodeIR.thisNode()static Nodestatic NodeIR.trueNode()static Nodestatic NodeIR.tryCatchFinally(Node tryBody, Node catchNode, Node finallyBody) static NodeIR.tryFinally(Node tryBody, Node finallyBody) static Nodestatic NodeTypeDeclarationsIR.undefinedType()static Nodestatic NodeRepresents a union type, which can be one of the given types.static Nodestatic Nodestatic Nodestatic NodeTypeDeclarationsIR.voidType()static Nodestatic NodeMethods 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 Nodefinal voidNode.addChildrenAfter(@Nullable Node children, @Nullable Node node) Add all children after 'node'.final voidNode.addChildrenToBack(Node children) final voidNode.addChildrenToFront(@Nullable Node children) Add all children to the front of this node.final voidNode.addChildToBack(Node child) final voidNode.addChildToFront(Node child) static Nodestatic Nodestatic NodeIR.arrayPattern(Node... keys) static NodeRepresents an array type.static NodeIR.arrowFunction(Node name, Node params, Node body) static Nodestatic Node"invalid input: '&'invalid input: '&'="static NodeIR.assignCoalesce(Node expr1, Node expr2) "??="static Node"||="static Nodestatic NodeIR.bitwiseAnd(Node expr1, Node expr2) "invalid input: '&'"static Nodestatic Nodestatic Nodestatic Nodestatic Nodestatic Nodestatic Nodefinal NodeNode.clonePropsFrom(Node other) Clone the properties from the provided node without copying the property object.static Nodestatic Nodestatic NodeIR.computedProp(Node key, Node value) static Nodestatic NodeIR.continueNode(Node name) static NodeIR.continueOptChainCall(Node target, Node... args) static NodeIR.continueOptChainGetelem(Node target, Node elem) static NodeIR.continueOptChainGetprop(Node target, String prop) final NodeNode.copyTypeFrom(Node other) Copies a nodes JSType or Color (if present)static Nodestatic NodeIR.declaration(Node lhs, Node value, Token type) static NodeIR.declaration(Node lhs, Token type) voidNominalTypeBuilder.declareConstructorProperty(String name, JSType type, Node defSite) Declares a static property on the nominal type's constructor.voidNominalTypeBuilder.declareInstanceProperty(String name, JSType type, Node defSite) Declares an instance property on the nominal type.voidNominalTypeBuilder.declarePrototypeProperty(String name, JSType type, Node defSite) Declares a property on the nominal type's prototype.static NodeIR.defaultCase(Node body) static Nodestatic Nodestatic Node"=="static Nodestatic NodeIR.exprResult(Node expr) static Nodestatic Nodestatic Nodestatic NodeTypeDeclarationsIR.functionType(Node returnType, LinkedHashMap<String, Node> requiredParams, LinkedHashMap<String, Node> optionalParams, String restName, Node restType) Represents a function type.static Node">="static Nodefinal intNode.getIndexOfChild(Node child) Gets the index of a child, note that this is O(N) where N is the number of children.static Nodestatic Nodestatic Nodefinal booleanstatic Nodestatic Nodestatic Nodestatic NodeIR.importNode(Node name, Node importSpecs, Node moduleIdentifier) static Nodestatic Nodefinal voidNode.insertAfter(Node existing) final voidNode.insertBefore(Node existing) final booleanNode.isDescendantOf(Node node) Is this Node the same asnodeor a descendant ofnode?final booleanNode.isEquivalentTo(Node node) Returns true if this node is equivalent semantically to anotherbooleanNode.isEquivalentTo(Node node, boolean compareType, boolean recurse, boolean jsDoc, boolean sideEffect) Returns whether this node is equivalent semantically to the provided node.final booleanNode.isEquivalentToShallow(Node node) Checks equivalence without going into child nodesfinal booleanNode.isEquivalentToTyped(Node node) Returns true if this node is equivalent semantically to another and the types are equivalent.final booleanNode.isEquivalentWithSideEffectsTo(Node node) Returns true if this node is equivalent semantically to another including side effects.final booleanNode.isEquivalentWithSideEffectsToShallow(Node node) Returns true if this node is equivalent semantically to another including side effects.final booleanNode.isFirstChildOf(Node possibleParent) final booleanNode.isOnlyChildOf(Node possibleParent) final booleanNode.isSecondChildOf(Node possibleParent) static Nodestatic NodeIR.iterSpread(Node expr) static Nodestatic Nodestatic Nodestatic Node"<"voidAdds a name declaration to the current marker.voidJSDocInfo.Builder.markTypeNode(Node typeNode, int lineno, int startCharno, int endLineno, int endCharno, boolean hasLC) Adds a type declaration to the current marker.abstract booleanChecks whether the given node matches this name.final booleanNode.matchesName(Node n) Check that if two NAME node match, returns false if either node is not a NAME node.final booleanNode.matchesQualifiedName(Node n) Returns whether a node matches a simple or a qualified name, such asxora.b.corthis.a.static booleanIR.mayBeExpression(Node n) It isn't possible to always determine if a detached node is a expression, so make a best guess.static booleanIR.mayBeStatement(Node n) It isn't possible to always determine if a detached node is a expression, so make a best guess.static NodeIR.memberFieldDef(String name, Node value) static NodeIR.memberFunctionDef(String name, Node function) static Node"!="static Nodestatic Nodestatic Nodestatic Nodestatic NodeIR.objectPattern(Node... keys) static NodeIR.objectRest(Node target) static NodeIR.objectSpread(Node expr) static NodeTypeDeclarationsIR.optionalParameter(Node parameterType) Represents a function parameter that is optional.static Nodestatic NodeTypeDeclarationsIR.parameterizedType(Node baseType, Iterable<Node> typeParameters) Represents a parameterized, or generic, type.static Nodestatic Nodestatic Nodestatic NodeIR.quotedStringKey(String s, Node value) booleanJSDocInfo.Builder.recordTypeTransformation(String name, Node expr) Records a type transformation expression together with its template type name.static Nodestatic Nodefinal voidNode.replaceWith(Node replacement) Swaps `replacement` and its subtree into the position of `this`.static NodeIR.returnNode(Node expr) static NodeIR.rightShift(Node expr1, Node expr2) ">>"static Nodestatic Nodefinal voidNode.setClosureUnawareShadow(@Nullable Node shadowRoot) final voidNode.setDeclaredTypeExpression(Node typeExpression) Sets the syntactical type specified on this node.final voidNode.setOriginalNameFromName(Node name) final voidNode.setStaticSourceFileFrom(Node other) static Nodestatic Node"==="static Node"!=="final NodeCopy the source info from `other` onto `this`.final NodeNode.srcrefIfMissing(Node other) Iff source info is not set on `this`, copy the source info from `other`.final NodeNode.srcrefTree(Node other) For all Nodes in the subtree of `this`, copy the source info from `other`.final NodeNode.srcrefTreeIfMissing(Node other) For all Nodes in the subtree of `this`, iff source info is not set, copy the source info from `other`.static NodeIR.startOptChainCall(Node target, Node... args) static NodeIR.startOptChainGetelem(Node target, Node elem) static NodeIR.startOptChainGetprop(Node target, String prop) static Nodestatic Nodestatic NodeIR.switchNode(Node cond, Node... cases) static NodeIR.templateLiteralSubstitution(Node child) static Nodestatic Nodestatic NodeIR.tryCatchFinally(Node tryBody, Node catchNode, Node finallyBody) static NodeIR.tryFinally(Node tryBody, Node finallyBody) static Nodestatic Nodestatic Nodestatic Nodestatic Nodestatic Nodestatic NodeMethod parameters in com.google.javascript.rhino with type arguments of type NodeModifier and TypeMethodDescriptionstatic Nodestatic Nodestatic NodeTypeDeclarationsIR.functionType(Node returnType, LinkedHashMap<String, Node> requiredParams, LinkedHashMap<String, Node> optionalParams, String restName, Node restType) Represents a function type.static NodeTypeDeclarationsIR.parameterizedType(Node baseType, Iterable<Node> typeParameters) Represents a parameterized, or generic, type.static NodeTypeDeclarationsIR.recordType(LinkedHashMap<String, Node> properties) Represents a structural type.static Nodestatic NodeRepresents 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 NodeSimpleReference.getNode()final @Nullable NodeObjectType.getOwnPropertyDefSite(String propertyName) final NodeObjectType.getPropertyDefSite(String propertyName) final @Nullable NodeObjectType.getPropertyNode(String propertyName) Gets the node corresponding to the definition of the specified property.final NodeEnumType.getSource()final NodeFunctionType.getSource()Gets the source node or null if this is an unknown function.@Nullable NodeJSType.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 booleanObjectType.defineDeclaredProperty(String propertyName, JSType type, Node propertyNode) Defines a property whose type is explicitly declared by the programmer.booleanEnumType.defineElement(String name, Node definingNode) Defines a new element on this enum.final booleanObjectType.defineInferredProperty(String propertyName, JSType type, Node propertyNode) Defines a property whose type is inferred.final booleanObjectType.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) voidJSTypeRegistry.registerNonLegacyClosureNamespace(String moduleName, Node definitionNode, JSType type) Registers a goog.module namespace (that does not have goog.module.declareLegacyNamespace)voidJSTypeRegistry.registerTemplateTypeNamesInScope(Iterable<TemplateType> keys, Node scopeRoot) Registers template types on the given scope root.voidvoidObjectType.setPropertyNode(String propertyName, Node defSite) Sets the node where the property was defined.voidPrototypeObjectType.setPropertyNode(String propertyName, Node defSite) The object literal that creates the enum, a reference to another enum, or null.final voidSets 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