Package | Description |
---|---|
com.google.javascript.jscomp |
Provides the core compiler and its public API.
|
com.google.javascript.jscomp.ijs | |
com.google.javascript.jscomp.lint |
Provides "lint" checks: Checks which are likely to provide a lot of false positives, and therefore
should not generally be turned on as errors, but which might be appropriate to include in a static
analysis tool.
|
com.google.javascript.jscomp.modules | |
com.google.javascript.jscomp.parsing |
Provides utilities to help with parsing JSDoc annotations and performing AST
transformations.
|
com.google.javascript.jscomp.type |
Provides type-checking data structures and algorithms.
|
com.google.javascript.refactoring | |
com.google.javascript.refactoring.examples | |
com.google.javascript.rhino |
The core AST from Rhino.
|
com.google.javascript.rhino.jstype |
Provides abstractions to represent types in JavaScript.
|
Modifier and Type | Field and Description |
---|---|
Node |
JSError.node
Node where the warning occurred.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<Node> |
NameBasedDefinitionProvider.definitionNodes |
protected java.util.Map<Node,com.google.javascript.jscomp.DefinitionSite> |
NameBasedDefinitionProvider.definitionSitesByDefinitionSiteNode |
protected com.google.common.collect.Multimap<Node,com.google.javascript.jscomp.DefinitionSite> |
NameBasedDefinitionProvider.definitionSitesByScopeNode |
Modifier and Type | Method and Description |
---|---|
static Node |
NodeUtil.emptyFunction() |
Node |
CodingConvention.AssertionFunctionSpec.getAssertedParam(Node firstParam)
Returns the parameter of the assertion function that is being checked.
|
static Node |
NodeUtil.getAssignedValue(Node n)
For an assignment or variable declaration get the assigned value.
|
Node |
CompilerInput.getAstRoot(AbstractCompiler compiler) |
Node |
SyntheticAst.getAstRoot(AbstractCompiler compiler) |
Node |
JsAst.getAstRoot(AbstractCompiler compiler) |
Node |
SourceAst.getAstRoot(AbstractCompiler compiler)
Gets the root node of the AST for the source file this represents.
|
Node |
RecoverableJsAst.getAstRoot(AbstractCompiler compiler) |
static Node |
NodeUtil.getBestJSDocInfoNode(Node n) |
static Node |
NodeUtil.getBestLValue(Node n)
Find the l-value that the given r-value is being assigned to.
|
static Node |
NodeUtil.getClassMembers(Node n) |
Node |
NodeTraversal.getClosestHoistScopeRoot() |
Node |
NodeTraversal.getCurrentFile() |
Node |
NodeTraversal.getCurrentNode()
Returns the node currently being traversed.
|
Node |
SymbolTable.Symbol.getDeclarationNode() |
static Node |
NodeUtil.getDeclaringParent(Node targetNode)
Returns the node that is effectively declaring the given target.
|
static Node |
NodeUtil.getEnclosingBlock(Node n)
Finds the block containing the given node.
|
static Node |
NodeUtil.getEnclosingBlockScopeRoot(Node n) |
static Node |
NodeUtil.getEnclosingClass(Node n)
Finds the class containing the given node.
|
Node |
NodeTraversal.getEnclosingFunction()
Examines the functions stack for the last instance of a function node.
|
static Node |
NodeUtil.getEnclosingFunction(Node n)
Finds the function containing the given node.
|
static Node |
NodeUtil.getEnclosingNode(Node n,
com.google.common.base.Predicate<Node> pred) |
static Node |
NodeUtil.getEnclosingScopeRoot(Node n) |
static Node |
NodeUtil.getEnclosingScript(Node n)
Finds the script containing the given node.
|
static Node |
NodeUtil.getEnclosingStatement(Node n) |
static Node |
NodeUtil.getEnclosingType(Node n,
Token type)
Gets the closest ancestor to the given node of the provided type.
|
static Node |
NodeUtil.getFunctionBody(Node fn)
Return a BLOCK node for the given FUNCTION node.
|
static Node |
NodeUtil.getFunctionParameters(Node fnNode) |
Node |
AbstractVar.getInitialValue() |
Node |
JsMessageDefinition.getMessageNode() |
Node |
AbstractVar.getNameNode() |
static Node |
NodeUtil.getNameNode(Node n)
Gets the node of a function or class's name.
|
Node |
AbstractVar.getNode() |
Node |
Reference.getNode() |
static Node |
NodeUtil.getNodeByLineCol(Node ancestor,
int lineNo,
int columNo) |
Node |
AbstractVar.getParentNode() |
Node |
Compiler.getRoot() |
abstract Node |
AbstractCompiler.getRoot()
Returns the root node of the AST, which includes both externs and source.
|
static Node |
NodeUtil.getRootTarget(Node targetNode)
Returns the outermost target enclosing the given assignment target.
|
static Node |
NodeUtil.getRValueOfLValue(Node n)
Gets the r-value (or initializer) of a node returned by getBestLValue.
|
Node |
AbstractVar.getScopeRoot() |
Node |
NodeTraversal.getScopeRoot()
Returns the current scope's root.
|
protected Node |
FileAwareWarningsGuard.getScriptNodeForError(JSError error) |
static Node |
NodeUtil.newDeclaration(Node lhs,
Node rhs,
Token declarationType) |
static Node |
NodeUtil.newPropertyAccess(AbstractCompiler compiler,
Node context,
java.lang.String name)
Creates a property access on the
context tree. |
static Node |
NodeUtil.newQName(AbstractCompiler compiler,
java.lang.String name)
Creates a node representing a qualified name.
|
static Node |
NodeUtil.newQNameDeclaration(AbstractCompiler compiler,
java.lang.String name,
Node value,
JSDocInfo info)
Creates a node representing a qualified name.
|
static Node |
NodeUtil.newQNameDeclaration(AbstractCompiler compiler,
java.lang.String name,
Node value,
JSDocInfo info,
Token type)
Creates a node representing a qualified name.
|
static Node |
NodeUtil.newUndefinedNode(Node srcReferenceNode)
Create a node for an empty result expression: "void 0"
|
Node |
Compiler.parse(SourceFile file) |
Modifier and Type | Method and Description |
---|---|
static java.util.List<Node> |
NodeUtil.findLhsNodesInNode(Node assigningParent)
Retrieves lhs nodes declared or assigned in a given assigning parent node.
|
java.util.Collection<Node> |
SymbolTable.getAllJSDocInfoNodes() |
static ControlFlowGraph<Node> |
ControlFlowAnalysis.getCfg(AbstractCompiler compiler,
Node cfgRoot) |
ControlFlowGraph<Node> |
NodeTraversal.getControlFlowGraph()
Gets the control flow graph for the current JS scope.
|
java.util.Map<java.lang.String,Node> |
CompilerOptions.getDefineReplacements()
Returns the map of define replacements.
|
static java.util.List<Node> |
NodeUtil.getParentChangeScopeNodes(java.util.List<Node> scopeNodes)
Returns the list of scope nodes which are parents of the provided list of scope nodes.
|
java.util.Map<java.lang.String,Node> |
TemplateAstMatcher.getTemplateNodeToMatchMap()
Returns a map from named template Nodes (such as parameters
or local variables) to Nodes that were matches from the last matched
template.
|
java.util.Map<java.lang.String,Node> |
CompilerOptions.getTweakReplacements()
Returns the map of tweak replacements.
|
static com.google.common.collect.ImmutableSet<Node> |
ConformanceWhitelister.getViolatingNodes(Compiler compiler,
Node externs,
Node ast,
Requirement requirement) |
static java.util.List<Node> |
NodeUtil.removeNestedChangeScopeNodes(java.util.List<Node> scopeNodes)
Removes any scope nodes from the provided list that are nested within some other scope node
also in the list.
|
Modifier and Type | Method and Description |
---|---|
protected void |
CodeGenerator.add(Node n) |
protected void |
CodeGenerator.add(Node n,
CodeGenerator.Context context) |
void |
SourceMap.addMapping(Node node,
com.google.debugging.sourcemap.FilePosition outputStartPosition,
com.google.debugging.sourcemap.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 |
ConformanceRules.AbstractRule.check(NodeTraversal t,
Node n) |
void |
CheckConformance.Rule.check(NodeTraversal t,
Node n)
Perform conformance check
|
protected abstract ConformanceRules.ConformanceResult |
ConformanceRules.AbstractRule.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.BanForOf.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.BanExpose.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.RequireUseStrict.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.BanThrowOfNonErrorTypes.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.BanNullDeref.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.BanUnknownThis.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.BanUnknownDirectThisPropsReferences.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.BanUnknownTypedClassPropsReferences.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.BanUnresolvedType.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.StrictBanUnresolvedType.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.BanGlobalVars.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.RequireFileoverviewVisibility.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.BanCreateElement.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.BanCreateDom.checkConformance(NodeTraversal t,
Node n) |
void |
CodingConvention.checkForCallingConventionDefinitions(Node getPropNode,
java.util.Map<java.lang.String,java.lang.String> delegateCallingConventions)
Checks for getprops that set the calling conventions on delegate methods.
|
void |
CodingConventions.Proxy.checkForCallingConventionDefinitions(Node n,
java.util.Map<java.lang.String,java.lang.String> delegateCallingConventions) |
protected void |
JsMessageVisitor.checkNode(Node node,
Token type)
Checks a node's type.
|
static boolean |
NodeUtil.containsType(Node node,
Token type) |
Scope |
Es6SyntacticScopeCreator.ScopeFactory.create(Scope parent,
Node n) |
com.google.javascript.jscomp.AbstractScope<?,?> |
SyntacticScopeCreator.createScope(Node n,
com.google.javascript.jscomp.AbstractScope<?,?> parent) |
Scope |
Es6SyntacticScopeCreator.createScope(Node n,
com.google.javascript.jscomp.AbstractScope<?,?> parent) |
static boolean |
CodingConventions.defaultIsFunctionCallThatAlwaysThrows(Node n,
java.lang.String alwaysThrowsFunctionName) |
SymbolTable.Reference |
SymbolTable.Symbol.defineReferenceAt(Node n) |
static void |
NodeUtil.deleteChildren(Node n,
AbstractCompiler compiler)
Permanently delete all the children of the given node, including reporting changes.
|
static void |
NodeUtil.deleteFunctionCall(Node n,
AbstractCompiler compiler)
Permanently delete the given call from the AST while maintaining a valid node structure, as
well as report the related AST changes to the given compiler.
|
static void |
NodeUtil.deleteNode(Node n,
AbstractCompiler compiler)
Permanently delete the given node from the AST, as well as report
the related AST changes/deletions to the given compiler.
|
CodingConvention.Cache |
CodingConvention.describeCachingCall(Node node)
Builds a
CodingConvention.Cache instance from the given call node and returns that instance, or null
if the Node does not resemble a cache utility call. |
CodingConvention.Cache |
CodingConventions.Proxy.describeCachingCall(Node node) |
CodingConvention.Cache |
ClosureCodingConvention.describeCachingCall(Node node) |
CodingConvention.Bind |
CodingConvention.describeFunctionBind(Node n)
A Bind instance or null.
|
CodingConvention.Bind |
CodingConventions.Proxy.describeFunctionBind(Node n) |
CodingConvention.Bind |
CodingConvention.describeFunctionBind(Node n,
boolean callerChecksTypes,
boolean iCheckTypes)
A Bind instance or null.
|
CodingConvention.Bind |
CodingConventions.Proxy.describeFunctionBind(Node n,
boolean callerChecksTypes,
boolean iCheckTypes) |
CodingConvention.Bind |
ClosureCodingConvention.describeFunctionBind(Node n,
boolean callerChecksTypes,
boolean iCheckTypes) |
void |
NodeTraversal.ChangeScopeRootCallback.enterChangeScopeRoot(AbstractCompiler compiler,
Node root) |
void |
ClosureCheckModule.enterModule(NodeTraversal t,
Node scopeRoot) |
abstract void |
NodeTraversal.AbstractModuleCallback.enterModule(NodeTraversal t,
Node scopeRoot)
Called immediately after entering a module.
|
void |
ClosureCheckModule.exitModule(NodeTraversal t,
Node scopeRoot) |
abstract void |
NodeTraversal.AbstractModuleCallback.exitModule(NodeTraversal t,
Node scopeRoot)
Called immediately before exiting a module.
|
java.lang.String |
CodingConvention.extractClassNameIfProvide(Node node,
Node parent)
Convenience method for determining provided dependencies amongst different
JS scripts.
|
java.lang.String |
CodingConventions.Proxy.extractClassNameIfProvide(Node node,
Node parent) |
java.lang.String |
ClosureCodingConvention.extractClassNameIfProvide(Node node,
Node parent)
Extracts X from goog.provide('X'), if the applied Node is goog.
|
java.lang.String |
CodingConvention.extractClassNameIfRequire(Node node,
Node parent)
Convenience method for determining required dependencies amongst different
JS scripts.
|
java.lang.String |
CodingConventions.Proxy.extractClassNameIfRequire(Node node,
Node parent) |
java.lang.String |
ClosureCodingConvention.extractClassNameIfRequire(Node node,
Node parent)
Extracts X from goog.require('X'), if the applied Node is goog.
|
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) |
boolean |
ClosureCodingConvention.extractIsModuleFile(Node node,
Node parent) |
static java.util.List<Node> |
NodeUtil.findLhsNodesInNode(Node assigningParent)
Retrieves lhs nodes declared or assigned in a given assigning parent node.
|
static int |
NodeUtil.getApproxRequiredArity(Node fun)
Counts the parameters of a function that are not marked optional or varargs.
|
JSType |
CodingConvention.AssertionFunctionSpec.getAssertedOldType(Node call,
JSTypeRegistry registry)
Returns the old type system type for a type assertion, or null if
the function asserts that the node must not be null or undefined.
|
JSType |
ClosureCodingConvention.AssertInstanceofSpec.getAssertedOldType(Node call,
JSTypeRegistry registry)
Returns the type for a type assertion, or null if the function asserts
that the node must not be null or undefined.
|
JSType |
ClosureCodingConvention.AssertFunctionByTypeName.getAssertedOldType(Node call,
JSTypeRegistry registry) |
Node |
CodingConvention.AssertionFunctionSpec.getAssertedParam(Node firstParam)
Returns the parameter of the assertion function that is being checked.
|
static Node |
NodeUtil.getAssignedValue(Node n)
For an assignment or variable declaration get the assigned value.
|
static JSDocInfo |
NodeUtil.getBestJSDocInfo(Node n)
Find the best JSDoc for the given node.
|
static Node |
NodeUtil.getBestJSDocInfoNode(Node n) |
static Node |
NodeUtil.getBestLValue(Node n)
Find the l-value that the given r-value is being assigned to.
|
static ControlFlowGraph<Node> |
ControlFlowAnalysis.getCfg(AbstractCompiler compiler,
Node cfgRoot) |
CodingConvention.SubclassRelationship |
CodingConvention.getClassesDefinedByCall(Node callNode)
Checks if the given method defines a subclass relationship,
and if it does, returns information on that relationship.
|
CodingConvention.SubclassRelationship |
CodingConventions.Proxy.getClassesDefinedByCall(Node callNode) |
CodingConvention.SubclassRelationship |
ClosureCodingConvention.getClassesDefinedByCall(Node callNode)
Checks if the given method defines a subclass relationship,
and if it does, returns information on that relationship.
|
static Node |
NodeUtil.getClassMembers(Node n) |
java.lang.String |
ProcessCommonJSModules.getCommonJsImportPath(Node requireCall) |
static java.lang.String |
ProcessCommonJSModules.getCommonJsImportPath(Node requireCall,
ModuleLoader.ResolutionMode resolutionMode) |
static com.google.common.collect.ImmutableList<JSError> |
ConformanceWhitelister.getConformanceErrors(Compiler compiler,
Node externs,
Node ast,
Requirement requirement) |
static int |
NodeUtil.getCount(Node n,
com.google.common.base.Predicate<Node> pred,
com.google.common.base.Predicate<Node> traverseChildrenPred) |
static JSTypeExpression |
NodeUtil.getDeclaredTypeExpression(Node declaration)
Return declared JSDoc type for the given name declaration, or null if none present.
|
static Node |
NodeUtil.getDeclaringParent(Node targetNode)
Returns the node that is effectively declaring the given target.
|
com.google.javascript.jscomp.DefinitionSite |
NameBasedDefinitionProvider.getDefinitionForFunction(Node function) |
java.util.Collection<com.google.javascript.jscomp.DefinitionsRemover.Definition> |
NameBasedDefinitionProvider.getDefinitionsReferencedAt(Node useSiteNode)
Returns a collection of definitions that characterize the possible values of a variable or
property.
|
CodingConvention.DelegateRelationship |
CodingConvention.getDelegateRelationship(Node callNode) |
CodingConvention.DelegateRelationship |
CodingConventions.Proxy.getDelegateRelationship(Node callNode) |
static Node |
NodeUtil.getEnclosingBlock(Node n)
Finds the block containing the given node.
|
static Node |
NodeUtil.getEnclosingBlockScopeRoot(Node n) |
static Node |
NodeUtil.getEnclosingClass(Node n)
Finds the class containing the given node.
|
static Node |
NodeUtil.getEnclosingFunction(Node n)
Finds the function containing the given node.
|
SymbolTable.SymbolScope |
SymbolTable.getEnclosingFunctionScope(Node n)
Gets the scope that contains the given node.
|
static Node |
NodeUtil.getEnclosingNode(Node n,
com.google.common.base.Predicate<Node> pred) |
SymbolTable.SymbolScope |
SymbolTable.getEnclosingScope(Node n)
Gets the scope that contains the given node.
|
static Node |
NodeUtil.getEnclosingScopeRoot(Node n) |
static Node |
NodeUtil.getEnclosingScript(Node n)
Finds the script containing the given node.
|
static Node |
NodeUtil.getEnclosingStatement(Node n) |
static Node |
NodeUtil.getEnclosingType(Node n,
Token type)
Gets the closest ancestor to the given node of the provided type.
|
static Node |
NodeUtil.getFunctionBody(Node fn)
Return a BLOCK node for the given FUNCTION node.
|
static Node |
NodeUtil.getFunctionParameters(Node fnNode) |
static InputId |
NodeUtil.getInputId(Node n) |
static NodeUtil.ValueType |
NodeUtil.getKnownValueType(Node n)
Apply the supplied predicate against
all possible result Nodes of the expression.
|
static java.lang.String |
NodeUtil.getName(Node n) |
static Node |
NodeUtil.getNameNode(Node n)
Gets the node of a function or class's name.
|
static java.lang.String |
NodeUtil.getNearestFunctionName(Node n)
Gets the function's name.
|
static Node |
NodeUtil.getNodeByLineCol(Node ancestor,
int lineNo,
int columNo) |
CodingConvention.ObjectLiteralCast |
CodingConvention.getObjectLiteralCast(Node callNode)
Checks if the given method performs a object literal cast, and if it does,
returns information on the cast.
|
CodingConvention.ObjectLiteralCast |
CodingConventions.Proxy.getObjectLiteralCast(Node callNode) |
CodingConvention.ObjectLiteralCast |
ClosureCodingConvention.getObjectLiteralCast(Node callNode) |
static Node |
NodeUtil.getRootTarget(Node targetNode)
Returns the outermost target enclosing the given assignment target.
|
static Node |
NodeUtil.getRValueOfLValue(Node n)
Gets the r-value (or initializer) of a node returned by getBestLValue.
|
static java.lang.String |
NameBasedDefinitionProvider.getSimplifiedName(Node node)
Extract a name from a node.
|
java.lang.String |
CodingConvention.getSingletonGetterClassName(Node callNode)
Checks if the given method defines a singleton getter, and if it does,
returns the name of the class with the singleton getter.
|
java.lang.String |
CodingConventions.Proxy.getSingletonGetterClassName(Node callNode) |
java.lang.String |
ClosureCodingConvention.getSingletonGetterClassName(Node callNode) |
java.lang.String |
ChromeCodingConvention.getSingletonGetterClassName(Node callNode) |
static StaticSourceFile |
NodeUtil.getSourceFile(Node n) |
static java.lang.String |
NodeUtil.getSourceName(Node n) |
static java.lang.String |
NodeUtil.getStringValue(Node n)
Gets the value of a node as a String, or null if it cannot be converted.
|
static com.google.common.collect.ImmutableSet<Node> |
ConformanceWhitelister.getViolatingNodes(Compiler compiler,
Node externs,
Node ast,
Requirement requirement) |
static com.google.common.collect.ImmutableSet<java.lang.String> |
ConformanceWhitelister.getViolatingPaths(Compiler compiler,
Node externs,
Node ast,
Requirement requirement) |
void |
AstValidator.ViolationHandler.handleViolation(java.lang.String message,
Node n) |
static boolean |
NodeUtil.has(Node node,
com.google.common.base.Predicate<Node> pred,
com.google.common.base.Predicate<Node> traverseChildrenPred) |
void |
DartSuperAccessorsPass.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6InjectRuntimeLibraries.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6ConvertSuperConstructorCalls.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteBlockScopedFunctionDeclaration.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
ClosureCheckModule.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
LateEs6ToEs3Converter.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
FieldCleanupPass.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6ForOfConverter.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6ExtractClasses.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckMissingAndExtraRequires.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
ReferenceCollectingCallback.hotSwapScript(Node scriptRoot,
Node originalRoot)
Same as process but only runs on a part of AST associated to one script.
|
void |
WhitespaceWrapGoogModules.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
MarkUntranspilableFeaturesAsRemoved.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteModules.hotSwapScript(Node scriptNode,
Node originalRoot) |
void |
Es6RewriteBlockScopedDeclaration.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteScriptsToModules.hotSwapScript(Node scriptNode,
Node originalRoot) |
void |
HotSwapCompilerPass.hotSwapScript(Node scriptRoot,
Node originalRoot)
Process the JS with root node root.
|
void |
Es6RenameVariablesInParamLists.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
RewriteObjectSpread.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteClass.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6ToEs3ClassSideInheritance.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6TypedToEs6Converter.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6NormalizeShorthandProperties.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteClassExtendsExpressions.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
RewriteAsyncFunctions.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
RewriteGoogJsImports.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
RewritePolyfills.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6ConvertSuper.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es7RewriteExponentialOperator.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteArrowFunction.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
RewriteAsyncIteration.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6CheckModule.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6SplitVariableDeclarations.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteRestAndSpread.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteDestructuring.hotSwapScript(Node scriptRoot,
Node originalRoot) |
java.util.List<java.lang.String> |
CodingConvention.identifyTypeDeclarationCall(Node n)
Checks if the given CALL node is forward-declaring any types,
and returns the name of the types if it is.
|
java.util.List<java.lang.String> |
CodingConventions.Proxy.identifyTypeDeclarationCall(Node n) |
java.util.List<java.lang.String> |
ClosureCodingConvention.identifyTypeDeclarationCall(Node n) |
boolean |
CodingConvention.isAliasingGlobalThis(Node n)
Whether this statement is creating an alias of the global object
|
boolean |
CodingConventions.Proxy.isAliasingGlobalThis(Node n) |
boolean |
ClosureCodingConvention.isAliasingGlobalThis(Node n) |
static boolean |
NodeUtil.isAnyFor(Node n) |
static boolean |
NodeUtil.isAssignmentOp(Node n) |
static boolean |
NodeUtil.isBlocklessArrowFunctionResult(Node n) |
static boolean |
NodeUtil.isBooleanResult(Node n) |
static boolean |
ControlFlowAnalysis.isBreakTarget(Node target,
java.lang.String label)
Checks if target is actually the break target of labeled continue.
|
static boolean |
NodeUtil.isCallOrNew(Node node) |
static boolean |
NodeUtil.isCallTo(Node n,
java.lang.String qualifiedName) |
static boolean |
NodeUtil.isClassDeclaration(Node n)
|
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) |
boolean |
ClosureCodingConvention.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.isEnhancedFor(Node n) |
static boolean |
ControlFlowGraph.isEnteringNewCfgNode(Node n) |
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.isFromTypeSummary(Node n)
Determine if the given SCRIPT is a @typeSummary file, like an i.js file
|
boolean |
CodingConvention.isFunctionCallThatAlwaysThrows(Node n)
Used by CheckMissingReturn.
|
boolean |
CodingConventions.Proxy.isFunctionCallThatAlwaysThrows(Node n) |
boolean |
ClosureCodingConvention.isFunctionCallThatAlwaysThrows(Node n) |
boolean |
ChromeCodingConvention.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.isGet(Node n)
Is this a GETPROP or GETELEM node?
|
static boolean |
NodeUtil.isHoistedFunctionDeclaration(Node n)
Is this node a hoisted function declaration? A function declaration in the
scope root is hoisted to the top of the scope.
|
static boolean |
NodeUtil.isImportedName(Node n) |
static boolean |
NodeUtil.isInFunction(Node n) |
boolean |
CodingConvention.isInlinableFunction(Node n) |
boolean |
CodingConventions.Proxy.isInlinableFunction(Node n) |
static boolean |
NodeUtil.isLhsByDestructuring(Node n)
Returns true if the node is a lhs value of a destructuring assignment For example, x in
var [x] = [1]; , var [...x] = [1]; , and var {a: x} = {a: 1} or a.b in ([a.b] = [1]); or ({key: a.b} = {key: 1}); |
static boolean |
NodeUtil.isLiteralValue(Node n,
boolean includeFunctions)
Returns true if this is a literal value.
|
static boolean |
NodeUtil.isLValue(Node n)
Determines whether this node is used as an L-value.
|
static boolean |
NodeUtil.isMethodDeclaration(Node n)
Is this node a class or object literal member function?
|
static boolean |
NodeUtil.isNameDeclaration(Node n)
Is this node a name declaration?
|
static boolean |
NodeUtil.isNamespaceDecl(Node n)
Returns true iff this node defines a namespace, e.g.,
/** @const * / var goog = {};
/** @const * / var goog = goog || {};
/** @const * / goog.math = goog.math || {};
|
static boolean |
NodeUtil.isNullOrUndefined(Node n) |
static boolean |
NodeUtil.isNumericResult(Node n)
Returns true if the result of node evaluation is always a number
|
static boolean |
NodeUtil.isObjectResult(Node n) |
static boolean |
NodeUtil.isObjLitProperty(Node node)
Returns true if the node is a property of an object literal.
|
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 |
CodingConvention.isPropertyTestFunction(Node call)
Whether this CALL function is testing for the existence of a property.
|
boolean |
CodingConventions.Proxy.isPropertyTestFunction(Node call) |
boolean |
ClosureCodingConvention.isPropertyTestFunction(Node call) |
boolean |
CodingConvention.isPrototypeAlias(Node getProp)
Whether this GETPROP node is an alias for an object prototype.
|
boolean |
CodingConventions.Proxy.isPrototypeAlias(Node getProp) |
static boolean |
NodeUtil.isPrototypePropertyDeclaration(Node n) |
static boolean |
NodeUtil.isStatement(Node n) |
static boolean |
NodeUtil.isStatementBlock(Node n) |
static boolean |
NodeUtil.isStatementParent(Node parent) |
static boolean |
NodeUtil.isStringResult(Node n) |
static boolean |
NodeUtil.isTopLevel(Node n) |
static boolean |
NodeUtil.isUndefined(Node n) |
boolean |
CodingConvention.isVarArgsParameter(Node parameter)
This checks whether a given parameter should be treated as a marker
for a variable argument list function.
|
boolean |
CodingConventions.Proxy.isVarArgsParameter(Node parameter) |
boolean |
GoogleCodingConvention.isVarArgsParameter(Node parameter) |
static JSError |
JSError.make(Node n,
CheckLevel level,
DiagnosticType type,
java.lang.String... arguments) |
static JSError |
JSError.make(Node n,
DiagnosticType type,
java.lang.String... arguments)
Creates a JSError from a file and Node position.
|
JSError |
NodeTraversal.makeError(Node n,
CheckLevel level,
DiagnosticType type,
java.lang.String... arguments)
Creates a JSError during NodeTraversal.
|
JSError |
NodeTraversal.makeError(Node n,
DiagnosticType type,
java.lang.String... arguments)
Creates a JSError during NodeTraversal.
|
static void |
NodeUtil.markFunctionsDeleted(Node node,
AbstractCompiler compiler)
Recurses through a tree, marking all function nodes deleted.
|
boolean |
TemplateAstMatcher.matches(Node n) |
static boolean |
NodeUtil.mayHaveSideEffects(Node n)
Returns true if the node which may have side effects when executed.
|
static boolean |
NodeUtil.mayHaveSideEffects(Node n,
AbstractCompiler compiler) |
static boolean |
ControlFlowAnalysis.mayThrowException(Node n)
Determines if the subtree might throw an exception.
|
static Node |
NodeUtil.newDeclaration(Node lhs,
Node rhs,
Token declarationType) |
static Node |
NodeUtil.newPropertyAccess(AbstractCompiler compiler,
Node context,
java.lang.String name)
Creates a property access on the
context tree. |
static Node |
NodeUtil.newQNameDeclaration(AbstractCompiler compiler,
java.lang.String name,
Node value,
JSDocInfo info)
Creates a node representing a qualified name.
|
static Node |
NodeUtil.newQNameDeclaration(AbstractCompiler compiler,
java.lang.String name,
Node value,
JSDocInfo info,
Token type)
Creates a node representing a qualified name.
|
static Node |
NodeUtil.newUndefinedNode(Node srcReferenceNode)
Create a node for an empty result expression: "void 0"
|
void |
ReferenceCollectingCallback.process(Node root) |
void |
FindModuleDependencies.process(Node root) |
void |
CrossChunkReferenceCollector.process(Node root) |
void |
AstValidator.process(Node externs,
Node root) |
void |
DartSuperAccessorsPass.process(Node externs,
Node root) |
void |
Es6InjectRuntimeLibraries.process(Node externs,
Node root) |
void |
Es6ConvertSuperConstructorCalls.process(Node externs,
Node root) |
void |
Es6RewriteBlockScopedFunctionDeclaration.process(Node externs,
Node root) |
void |
ClosureCheckModule.process(Node externs,
Node root) |
void |
LateEs6ToEs3Converter.process(Node externs,
Node root) |
void |
FieldCleanupPass.process(Node externs,
Node root) |
void |
Es6ForOfConverter.process(Node externs,
Node root) |
void |
Es6ExtractClasses.process(Node externs,
Node root) |
void |
Es6RewriteModulesToCommonJsModules.process(Node externs,
Node root) |
void |
CheckMissingAndExtraRequires.process(Node externs,
Node root) |
void |
DefinitionUseSiteFinder.process(Node externs,
Node source) |
void |
ExportTestFunctions.process(Node externs,
Node root) |
void |
ReferenceCollectingCallback.process(Node externs,
Node root)
Convenience method for running this pass over a tree with this
class as a callback.
|
void |
WhitespaceWrapGoogModules.process(Node externs,
Node root) |
void |
J2clClinitPrunerPass.process(Node externs,
Node root) |
void |
NameBasedDefinitionProvider.process(Node externs,
Node source) |
void |
MarkUntranspilableFeaturesAsRemoved.process(Node externs,
Node root) |
void |
J2clAssertRemovalPass.process(Node externs,
Node root) |
void |
J2clUtilGetDefineRewriterPass.process(Node externs,
Node root) |
void |
J2clPropertyInlinerPass.process(Node externs,
Node root) |
void |
J2clChecksPass.process(Node externs,
Node root) |
void |
RewriteJsonToModule.process(Node externs,
Node root)
Module rewriting is done a on per-file basis prior to main compilation.
|
void |
J2clPass.process(Node externs,
Node root) |
void |
Es6RewriteModules.process(Node externs,
Node root) |
void |
Es6RewriteBlockScopedDeclaration.process(Node externs,
Node root) |
void |
Es6RewriteScriptsToModules.process(Node externs,
Node root) |
void |
JsMessageVisitor.process(Node externs,
Node root) |
void |
Es6RenameVariablesInParamLists.process(Node externs,
Node root) |
void |
RewriteObjectSpread.process(Node externs,
Node root) |
void |
Es6RewriteClass.process(Node externs,
Node root) |
void |
Es6ToEs3ClassSideInheritance.process(Node externs,
Node root) |
void |
J2clConstantHoisterPass.process(Node externs,
Node root) |
void |
Es6TypedToEs6Converter.process(Node externs,
Node scriptRoot) |
void |
Es6NormalizeShorthandProperties.process(Node externs,
Node root) |
void |
CheckConformance.process(Node externs,
Node root) |
void |
Es6RewriteClassExtendsExpressions.process(Node externs,
Node root) |
void |
Es6RelativizeImportPaths.process(Node externs,
Node root) |
void |
DeadPropertyAssignmentElimination.process(Node externs,
Node root) |
void |
ChromePass.process(Node externs,
Node root) |
void |
ControlFlowAnalysis.process(Node externs,
Node root) |
void |
RewriteAsyncFunctions.process(Node externs,
Node root) |
void |
RewriteGoogJsImports.process(Node externs,
Node root) |
void |
CrossChunkReferenceCollector.process(Node externs,
Node root)
Convenience method for running this pass over a tree with this
class as a callback.
|
void |
RewritePolyfills.process(Node externs,
Node root) |
void |
Es6ConvertSuper.process(Node externs,
Node root) |
void |
GatherModuleMetadata.process(Node externs,
Node root) |
void |
ProcessCommonJSModules.process(Node externs,
Node root) |
void |
Es7RewriteExponentialOperator.process(Node externs,
Node root) |
void |
Es6RewriteArrowFunction.process(Node externs,
Node root) |
void |
RewriteAsyncIteration.process(Node externs,
Node root) |
void |
Es6CheckModule.process(Node externs,
Node root) |
void |
Es6SplitVariableDeclarations.process(Node externs,
Node root) |
void |
TransformAMDToCJSModule.process(Node externs,
Node root) |
void |
CompilerPass.process(Node externs,
Node root)
Process the JS with root node root.
|
void |
ImplicitNullabilityCheck.process(Node externs,
Node root) |
void |
Es6RewriteRestAndSpread.process(Node externs,
Node root) |
void |
Es6RewriteDestructuring.process(Node externs,
Node root) |
void |
TypeCheck.process(Node externsRoot,
Node jsRoot)
Main entry point for this phase of processing.
|
TypedScope |
TypeCheck.processForTesting(Node externsRoot,
Node jsRoot)
Main entry point of this phase for testing code.
|
static void |
NodeUtil.removeChild(Node parent,
Node node)
Safely remove children while maintaining a valid node structure.
|
static void |
NodeUtil.removeName(Node n)
Set the given function/class node to an empty name
|
static void |
NodeUtil.replaceDeclarationChild(Node declChild,
Node newStatement)
Replace the child of a var/let/const declaration (usually a name) with a new statement.
|
protected void |
ConformanceRules.AbstractRule.report(Node n,
ConformanceRules.ConformanceResult result)
Report a conformance warning for the given node.
|
void |
NodeTraversal.report(Node n,
DiagnosticType diagnosticType,
java.lang.String... arguments)
Reports a diagnostic (error or warning)
|
void |
Compiler.reportChangeToChangeScope(Node changeScopeRoot) |
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.reportChangeToEnclosingScope(Node n) |
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 |
NodeTraversal.reportCodeChange(Node n) |
void |
Compiler.reportFunctionDeleted(Node n) |
boolean |
DartSuperAccessorsPass.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
Es6ConvertSuperConstructorCalls.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
LateEs6ToEs3Converter.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
Es6ForOfConverter.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
CheckMissingAndExtraRequires.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
ReferenceCollectingCallback.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent)
Updates block stack.
|
boolean |
Es6RewriteScriptsToModules.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
RewriteObjectSpread.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
Es6RewriteClass.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
Es6TypedToEs6Converter.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
CheckConformance.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
ControlFlowGraph.AbstractCfgNodeTraversalCallback.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
FindModuleDependencies.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
ControlFlowAnalysis.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
RewriteAsyncFunctions.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
CrossChunkReferenceCollector.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
ProcessCommonJSModules.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
Es7RewriteExponentialOperator.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
Es6RewriteArrowFunction.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
RewriteAsyncIteration.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
NodeTraversal.Callback.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent)
Visits a node in pre order (before visiting its children) and decides
whether this node's children should be traversed.
|
boolean |
NodeTraversal.AbstractPostOrderCallback.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
NodeTraversal.AbstractScopedCallback.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
NodeTraversal.AbstractShallowCallback.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
NodeTraversal.AbstractShallowStatementCallback.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
NodeTraversal.AbstractModuleCallback.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
NodeTraversal.AbstractNodeTypePruningCallback.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
Es6RewriteDestructuring.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
TypeCheck.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
void |
Es6SplitVariableDeclarations.splitDeclaration(NodeTraversal t,
Node n,
Node parent) |
static java.lang.String |
DotFormatter.toDot(Node n)
Converts an AST to dot representation.
|
void |
Compiler.toSource(Compiler.CodeBuilder cb,
int inputSeqNum,
Node root)
Writes out JS code from a root node.
|
java.lang.String |
Compiler.toSource(Node n)
Generates JavaScript source code for an AST, doesn't generate source
map info.
|
abstract java.lang.String |
AbstractCompiler.toSource(Node root)
Prints a node to source code.
|
static void |
NodeTraversal.traverse(AbstractCompiler compiler,
Node root,
NodeTraversal.Callback cb)
Traverses using the ES6SyntacticScopeCreator
|
void |
NodeTraversal.traverse(Node root)
Traverses a parse tree recursively.
|
static void |
NodeTraversal.traverseEs6(AbstractCompiler compiler,
Node root,
NodeTraversal.Callback cb)
Deprecated.
|
void |
NodeTraversal.traverseFunctionOutOfBand(Node node,
com.google.javascript.jscomp.AbstractScope<?,?> scope)
Traverse a function out-of-band of normal traversal.
|
static void |
NodeTraversal.traversePostOrder(AbstractCompiler compiler,
Node root,
NodeTraversal.AbstractPostOrderCallbackInterface cb)
Traverses in post order.
|
static void |
NodeTraversal.traverseRoots(AbstractCompiler compiler,
NodeTraversal.Callback cb,
Node externs,
Node root) |
static void |
NodeTraversal.traverseRootsTyped(AbstractCompiler compiler,
NodeTraversal.Callback cb,
Node externs,
Node root)
Deprecated.
Use the ES6SyntacticScopeCreator instead.
|
static void |
NodeTraversal.traverseScopeRoots(AbstractCompiler compiler,
Node root,
java.util.List<Node> scopeNodes,
NodeTraversal.Callback cb,
boolean traverseNested)
Traverses *just* the contents of provided scope nodes (and optionally scopes nested within
them) but will fall back on traversing the entire AST from root if a null scope nodes list is
provided.
|
static void |
NodeTraversal.traverseScopeRoots(AbstractCompiler compiler,
Node root,
java.util.List<Node> scopeNodes,
NodeTraversal.Callback cb,
NodeTraversal.ChangeScopeRootCallback changeCallback,
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 |
NodeTraversal.traverseTyped(AbstractCompiler compiler,
Node root,
NodeTraversal.Callback cb)
Deprecated.
Use the ES6SyntacticScopeCreator instead.
|
static boolean |
NodeUtil.tryMergeBlock(Node block,
boolean alwaysMerge)
Merge a block with its parent block.
|
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) |
void |
AstValidator.validateStatements(Node n) |
void |
NodeUtil.Visitor.visit(Node node) |
void |
BranchCoverageInstrumentationCallback.visit(NodeTraversal traversal,
Node node,
Node parent) |
void |
DartSuperAccessorsPass.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6InjectRuntimeLibraries.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6ConvertSuperConstructorCalls.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RewriteBlockScopedFunctionDeclaration.visit(NodeTraversal t,
Node n,
Node parent) |
void |
ClosureCheckModule.visit(NodeTraversal t,
Node n,
Node parent) |
void |
LateEs6ToEs3Converter.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6ForOfConverter.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6ExtractClasses.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckMissingAndExtraRequires.visit(NodeTraversal t,
Node n,
Node parent) |
void |
ReferenceCollectingCallback.visit(NodeTraversal t,
Node n,
Node parent)
For each node, update the block stack and reference collection
as appropriate.
|
void |
MarkUntranspilableFeaturesAsRemoved.visit(NodeTraversal t,
Node n,
Node parent) |
void |
J2clAssertRemovalPass.visit(NodeTraversal t,
Node node,
Node parent) |
void |
J2clUtilGetDefineRewriterPass.visit(NodeTraversal t,
Node n,
Node parent) |
void |
J2clChecksPass.visit(NodeTraversal t,
Node n,
Node parent) |
void |
RewriteJsonToModule.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RewriteModules.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RewriteBlockScopedDeclaration.visit(NodeTraversal t,
Node n,
Node parent) |
void |
JsMessageVisitor.visit(NodeTraversal traversal,
Node node,
Node parent) |
void |
Es6RenameVariablesInParamLists.visit(NodeTraversal t,
Node n,
Node parent) |
void |
RewriteObjectSpread.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RewriteClass.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6TypedToEs6Converter.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6NormalizeShorthandProperties.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckConformance.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RewriteClassExtendsExpressions.visit(NodeTraversal t,
Node n,
Node parent) |
void |
ChromePass.visit(NodeTraversal t,
Node node,
Node parent) |
void |
FindModuleDependencies.visit(NodeTraversal t,
Node n,
Node parent) |
void |
ControlFlowAnalysis.visit(NodeTraversal t,
Node n,
Node parent) |
void |
RewriteAsyncFunctions.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 |
Es6ConvertSuper.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es7RewriteExponentialOperator.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RewriteArrowFunction.visit(NodeTraversal t,
Node n,
Node parent) |
void |
RewriteAsyncIteration.visit(NodeTraversal t,
Node n,
Node parent) |
void |
NodeTraversal.Callback.visit(NodeTraversal t,
Node n,
Node parent)
Visits a node in postorder (after its children have been visited).
|
void |
NodeTraversal.AbstractPostOrderCallbackInterface.visit(NodeTraversal t,
Node n,
Node parent) |
void |
NodeTraversal.AbstractPreOrderCallback.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6CheckModule.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6SplitVariableDeclarations.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 |
Es6RewriteRestAndSpread.visit(NodeTraversal traversal,
Node current,
Node parent) |
void |
Es6RewriteDestructuring.visit(NodeTraversal t,
Node n,
Node parent) |
void |
TypeCheck.visit(NodeTraversal t,
Node n,
Node parent)
This is the meat of the type checking.
|
static void |
NodeUtil.visitPostOrder(Node node,
NodeUtil.Visitor visitor)
A post-order traversal, calling Visitor.visit for each decendent.
|
static void |
NodeUtil.visitPostOrder(Node node,
NodeUtil.Visitor visitor,
com.google.common.base.Predicate<Node> traverseChildrenPred)
A post-order traversal, calling Visitor.visit for each descendant matching the predicate.
|
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 child matching the predicate.
|
Modifier and Type | Method and Description |
---|---|
static int |
NodeUtil.getCount(Node n,
com.google.common.base.Predicate<Node> pred,
com.google.common.base.Predicate<Node> traverseChildrenPred) |
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 java.util.List<Node> |
NodeUtil.getParentChangeScopeNodes(java.util.List<Node> scopeNodes)
Returns the list of scope nodes which are parents of the provided list of scope nodes.
|
static boolean |
NodeUtil.has(Node node,
com.google.common.base.Predicate<Node> pred,
com.google.common.base.Predicate<Node> traverseChildrenPred) |
static boolean |
NodeUtil.has(Node node,
com.google.common.base.Predicate<Node> pred,
com.google.common.base.Predicate<Node> traverseChildrenPred) |
void |
DefinitionUseSiteFinder.rebuildScopeRoots(java.util.List<Node> changedScopeRoots,
java.util.List<Node> deletedScopeRoots) |
void |
DefinitionUseSiteFinder.rebuildScopeRoots(java.util.List<Node> changedScopeRoots,
java.util.List<Node> deletedScopeRoots) |
void |
NameBasedDefinitionProvider.rebuildScopeRoots(java.util.List<Node> changedScopeRoots,
java.util.List<Node> deletedScopeRoots) |
void |
NameBasedDefinitionProvider.rebuildScopeRoots(java.util.List<Node> changedScopeRoots,
java.util.List<Node> deletedScopeRoots) |
static java.util.List<Node> |
NodeUtil.removeNestedChangeScopeNodes(java.util.List<Node> scopeNodes)
Removes any scope nodes from the provided list that are nested within some other scope node
also in the list.
|
static void |
NodeTraversal.traverseScopeRoots(AbstractCompiler compiler,
Node root,
java.util.List<Node> scopeNodes,
NodeTraversal.Callback cb,
boolean traverseNested)
Traverses *just* the contents of provided scope nodes (and optionally scopes nested within
them) but will fall back on traversing the entire AST from root if a null scope nodes list is
provided.
|
static void |
NodeTraversal.traverseScopeRoots(AbstractCompiler compiler,
Node root,
java.util.List<Node> scopeNodes,
NodeTraversal.Callback cb,
NodeTraversal.ChangeScopeRootCallback changeCallback,
boolean traverseNested)
Traverses *just* the contents of provided scope nodes (and optionally scopes nested within
them) but will fall back on traversing the entire AST from root if a null scope nodes list is
provided.
|
static void |
NodeUtil.visitPostOrder(Node node,
NodeUtil.Visitor visitor,
com.google.common.base.Predicate<Node> traverseChildrenPred)
A post-order traversal, calling Visitor.visit for each descendant matching the predicate.
|
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 child matching the predicate.
|
Constructor and Description |
---|
Bind(Node target,
Node thisValue,
Node parameters) |
Builder(Node node)
Sets the root node from which to generate the source code.
|
Cache(Node cacheObj,
Node key,
Node valueFn,
Node keyFn) |
SubclassRelationship(CodingConvention.SubclassType type,
Node subclassNode,
Node superclassNode) |
SyntheticAst(Node root) |
TemplateAstMatcher(JSTypeRegistry typeRegistry,
Node templateFunctionNode,
TypeMatchingStrategy typeMatchingStrategy)
Constructs this matcher with a Function node that serves as the template
to match all other nodes against.
|
Modifier and Type | Method and Description |
---|---|
void |
ConvertToTypedInterface.process(Node externs,
Node root) |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
CheckRequiresAndProvidesSorted.getSortKey(Node n) |
static boolean |
CheckNullableReturn.hasReturnDeclaredNullable(Node n) |
void |
CheckArrayWithGoogObject.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckPrototypeProperties.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckRequiresAndProvidesSorted.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckNullableReturn.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckUnusedLabels.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckPrimitiveAsObject.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckUselessBlocks.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckDuplicateCase.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckInterfaces.hotSwapScript(Node scriptRoot,
Node originalRoot) |
boolean |
CheckArrayWithGoogObject.isGoogObjectIterationOverArray(Node n) |
void |
CheckArrayWithGoogObject.process(Node externs,
Node root) |
void |
CheckPrototypeProperties.process(Node externs,
Node root) |
void |
CheckMissingSemicolon.process(Node externs,
Node root) |
void |
CheckRequiresAndProvidesSorted.process(Node externs,
Node root) |
void |
CheckEmptyStatements.process(Node externs,
Node root) |
void |
CheckJSDocStyle.process(Node externs,
Node root) |
void |
CheckNullableReturn.process(Node externs,
Node root) |
void |
CheckEs6ModuleFileStructure.process(Node externs,
Node root) |
void |
CheckNoMutatedEs6Exports.process(Node externs,
Node root) |
void |
CheckEs6Modules.process(Node externs,
Node root) |
void |
CheckUnusedLabels.process(Node externs,
Node root) |
void |
CheckNullabilityModifiers.process(Node externs,
Node root) |
void |
CheckPrimitiveAsObject.process(Node externs,
Node root) |
void |
CheckUselessBlocks.process(Node externs,
Node root) |
void |
CheckDuplicateCase.process(Node externs,
Node root) |
void |
CheckInterfaces.process(Node externs,
Node root) |
void |
CheckEnums.process(Node externs,
Node root) |
boolean |
CheckPrototypeProperties.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
CheckNullableReturn.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
CheckEs6ModuleFileStructure.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
CheckNoMutatedEs6Exports.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
CheckEs6Modules.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
CheckUnusedLabels.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
CheckUselessBlocks.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
void |
CheckArrayWithGoogObject.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckPrototypeProperties.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckMissingSemicolon.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckRequiresAndProvidesSorted.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckEmptyStatements.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckJSDocStyle.visit(NodeTraversal t,
Node n,
Node unused) |
void |
CheckNullableReturn.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckNoMutatedEs6Exports.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckEs6Modules.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckUnusedLabels.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 |
CheckUselessBlocks.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckDuplicateCase.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckInterfaces.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckEnums.visit(NodeTraversal t,
Node n,
Node parent) |
Modifier and Type | Method and Description |
---|---|
static boolean |
CheckNullableReturn.canReturnNull(ControlFlowGraph<Node> graph) |
Modifier and Type | Method and Description |
---|---|
abstract Node |
Export.exportNode()
Node that this export originates from.
|
abstract Node |
Import.importNode()
Returns the import node for source information.
|
abstract Node |
Import.nameNode()
Returns the name node for source information.
|
abstract Node |
Export.nameNode()
Node that this export originates from.
|
abstract Node |
Binding.sourceNode()
The AST node to use for source location when rewriting.
|
Modifier and Type | Field and Description |
---|---|
Node |
ParserRunner.ParseResult.ast |
Modifier and Type | Method and Description |
---|---|
Node |
TypeTransformationParser.getTypeTransformationAst() |
static Node |
JsDocInfoParser.parseTypeString(java.lang.String typeString)
Parses a string containing a JsDoc type declaration, returning the
type if the parsing succeeded or
null if it failed. |
Constructor and Description |
---|
ParseResult(Node ast,
java.util.List<Comment> comments,
FeatureSet features,
java.lang.String sourceMapURL) |
Modifier and Type | Method and Description |
---|---|
protected FlowScope |
ChainableReverseAbstractInterpreter.declareNameInScope(FlowScope scope,
Node node,
JSType type)
Declares a refined type in
scope for the name represented by node . |
protected FlowScope |
ChainableReverseAbstractInterpreter.firstPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome)
Calculates the preciser scope starting with the first link.
|
FlowScope |
ClosureReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome) |
FlowScope |
SemanticReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome) |
FlowScope |
ReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome)
Calculates a precise version of the scope knowing the outcome of the
condition.
|
protected JSType |
ChainableReverseAbstractInterpreter.getTypeIfRefinable(Node node,
FlowScope scope)
Returns the type of a node in the given scope if the node corresponds to a
name whose type is capable of being refined.
|
FlowScope |
FlowScope.inferQualifiedSlot(Node node,
java.lang.String symbol,
JSType bottomType,
JSType inferredType,
boolean declare)
Returns a flow scope with the type of the given
symbol updated to inferredType . |
protected FlowScope |
ChainableReverseAbstractInterpreter.nextPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome)
Delegates the calculation of the preciser scope to the next link.
|
Modifier and Type | Method and Description |
---|---|
Node |
Match.getNode()
Returns the node that matched the given conditions.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,Node> |
JsSourceMatcher.getTemplateNodeToMatchMap()
Returns a map from named template node strings to Nodes that were the
equivalent matches from the last matched template.
|
Modifier and Type | Method and Description |
---|---|
SuggestedFix.Builder |
SuggestedFix.Builder.addCast(Node n,
AbstractCompiler compiler,
java.lang.String type)
Adds a cast of the given type to the provided node.
|
SuggestedFix.Builder |
SuggestedFix.Builder.addChildToFront(Node parentNode,
java.lang.String content)
Inserts a new node as the first child of the provided node.
|
SuggestedFix.Builder |
SuggestedFix.Builder.addOrReplaceJsDoc(Node n,
java.lang.String newJsDoc)
Adds or replaces the JS Doc for the given node.
|
SuggestedFix.Builder |
SuggestedFix.Builder.attachMatchedNodeInfo(Node node,
AbstractCompiler compiler)
Sets the node on this SuggestedFix that caused this SuggestedFix to be built in the first
place.
|
SuggestedFix.Builder |
SuggestedFix.Builder.changeJsDocType(Node n,
AbstractCompiler compiler,
java.lang.String type)
Changes the JS Doc Type of the given node.
|
SuggestedFix.Builder |
SuggestedFix.Builder.delete(Node n)
Deletes a node and its contents from the source file.
|
SuggestedFix.Builder |
SuggestedFix.Builder.deleteArgument(Node n,
int position)
Deletes an argument from an existing function call, including any JS doc that precedes it.
|
SuggestedFix.Builder |
SuggestedFix.Builder.deleteWithoutRemovingWhitespace(Node n)
Deletes a node without touching any surrounding whitespace.
|
SuggestedFix.Builder |
SuggestedFix.Builder.deleteWithoutRemovingWhitespaceBefore(Node n)
Deletes a node and its contents from the source file.
|
java.lang.String |
SuggestedFix.Builder.generateCode(AbstractCompiler compiler,
Node node) |
SuggestedFix.Builder |
SuggestedFix.Builder.insertAfter(Node node,
java.lang.String text)
Inserts the text after the given node
|
SuggestedFix.Builder |
SuggestedFix.Builder.insertArguments(Node n,
int position,
java.lang.String... args)
Inserts arguments into an existing function call.
|
SuggestedFix.Builder |
SuggestedFix.Builder.insertBefore(Node nodeToInsertBefore,
Node n,
AbstractCompiler compiler)
Inserts a new node before the provided node.
|
SuggestedFix.Builder |
SuggestedFix.Builder.insertBefore(Node nodeToInsertBefore,
java.lang.String content)
Inserts a string before the provided node.
|
static boolean |
RefactoringUtils.isInClosurizedFile(Node node,
NodeMetadata metadata)
Looks for a goog.require(), goog.provide() or goog.module() call in the node's file.
|
abstract boolean |
Scanner.matches(Node node,
NodeMetadata t)
Returns true if the given node and node traversal should match for this
particular scanner.
|
boolean |
Matcher.matches(Node n,
NodeMetadata metadata)
Returns true if the specified
Node and NodeMetadata match
the given pattern. |
boolean |
RefasterJsScanner.matches(Node node,
NodeMetadata metadata) |
boolean |
JsSourceMatcher.matches(Node n,
NodeMetadata metadata) |
SuggestedFix.Builder |
SuggestedFix.Builder.removeCast(Node n,
AbstractCompiler compiler)
Removes a cast from the given node.
|
SuggestedFix.Builder |
SuggestedFix.Builder.rename(Node n,
java.lang.String name)
Renames a given node to the provided name.
|
SuggestedFix.Builder |
SuggestedFix.Builder.rename(Node n,
java.lang.String name,
boolean replaceEntireName)
Renames a given node to the provided name.
|
SuggestedFix.Builder |
SuggestedFix.Builder.replace(Node original,
Node newNode,
AbstractCompiler compiler)
Replaces the provided node with new node in the source file.
|
SuggestedFix.Builder |
SuggestedFix.Builder.replaceRange(Node first,
Node last,
java.lang.String newContent)
Replaces a range of nodes with the given content.
|
Constructor and Description |
---|
JsSourceMatcher(JSTypeRegistry typeRegistry,
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) |
Modifier and Type | Method and Description |
---|---|
boolean |
GoogBindToArrow.matches(Node node,
NodeMetadata metadata) |
Modifier and Type | Class and Description |
---|---|
static class |
Node.TypeDeclarationNode
Represents a node in the type declaration AST.
|
Modifier and Type | Field and Description |
---|---|
protected Node |
Node.parent |
Modifier and Type | Method and Description |
---|---|
static Node |
IR.add(Node expr1,
Node expr2) |
static Node |
IR.and(Node expr1,
Node expr2) |
static Node |
IR.arraylit(Node... exprs) |
static Node |
IR.arrayPattern(Node... keys) |
static Node |
IR.arrowFunction(Node name,
Node params,
Node body) |
static Node |
IR.assign(Node target,
Node expr) |
static Node |
IR.await(Node expr) |
static Node |
IR.block() |
static Node |
IR.block(java.util.List<Node> stmts) |
static Node |
IR.block(Node... stmts) |
static Node |
IR.block(Node stmt) |
static Node |
IR.breakNode() |
static Node |
IR.breakNode(Node name) |
static Node |
IR.call(Node target,
Node... args) |
static Node |
IR.caseNode(Node expr,
Node body) |
static Node |
IR.cast(Node expr1,
JSDocInfo jsdoc) |
static Node |
IR.catchNode(Node expr,
Node body) |
Node |
Node.cloneNode() |
protected Node |
Node.cloneNode(boolean cloneTypeExprs) |
Node |
Node.clonePropsFrom(Node other)
Clone the properties from the provided node without copying
the property object.
|
Node |
Node.cloneTree() |
Node |
Node.cloneTree(boolean cloneTypeExprs) |
static Node |
IR.comma(Node expr1,
Node expr2) |
static Node |
IR.computedProp(Node key,
Node value) |
static Node |
IR.constNode(Node lhs,
Node value) |
static Node |
IR.continueNode() |
static Node |
IR.continueNode(Node name) |
static Node |
IR.dec(Node exp,
boolean isPost) |
static Node |
IR.declaration(Node lhs,
Node value,
Token type) |
static Node |
IR.declaration(Node lhs,
Token type) |
static Node |
IR.defaultCase(Node body) |
static Node |
IR.delprop(Node target) |
Node |
Node.detach()
Removes this node from its parent.
|
Node |
Node.detachFromParent()
Removes this node from its parent.
|
static Node |
IR.doNode(Node body,
Node cond) |
static Node |
IR.empty() |
static Node |
IR.eq(Node expr1,
Node expr2)
"=="
|
static Node |
IR.export(Node declaration) |
static Node |
IR.exprResult(Node expr) |
static Node |
IR.falseNode() |
static Node |
IR.forIn(Node target,
Node cond,
Node body) |
static Node |
IR.forNode(Node init,
Node cond,
Node incr,
Node body) |
static Node |
IR.function(Node name,
Node params,
Node body) |
Node |
Node.getAncestor(int level)
Gets the ancestor node relative to this.
|
Node |
Node.getChildAtIndex(int i)
Gets the ith child, note that this is O(N) where N is the number of children.
|
Node |
Node.getChildBefore(Node child) |
static Node |
IR.getelem(Node target,
Node elem) |
Node |
Node.getFirstChild() |
Node |
Node.getFirstFirstChild()
Get the first child of the first child.
|
Node |
Node.getGrandparent() |
Node |
Node.getLastChild() |
Node |
Node.getNext() |
Node |
StaticRef.getNode()
The node where the reference lives.
|
Node |
Node.getOnlyChild() |
Node |
Node.getParent() |
Node |
Node.getPrevious() |
static Node |
IR.getprop(Node target,
Node prop) |
static Node |
IR.getprop(Node target,
Node prop,
Node... moreProps) |
static Node |
IR.getprop(Node target,
java.lang.String prop,
java.lang.String... moreProps) |
Node |
JSTypeExpression.getRoot() |
Node |
StaticScope.getRootNode()
Returns the root node associated with this scope.
|
Node |
Node.getSecondChild() |
static Node |
IR.hook(Node cond,
Node trueval,
Node falseval) |
static Node |
IR.ifNode(Node cond,
Node then) |
static Node |
IR.ifNode(Node cond,
Node then,
Node elseNode) |
static Node |
IR.importNode(Node name,
Node importSpecs,
Node moduleIdentifier) |
static Node |
IR.importStar(java.lang.String name) |
static Node |
IR.in(Node expr1,
Node expr2) |
static Node |
IR.inc(Node exp,
boolean isPost) |
static Node |
IR.label(Node name,
Node stmt) |
static Node |
IR.labelName(java.lang.String name) |
static Node |
IR.let(Node lhs,
Node value) |
static Node |
IR.lt(Node expr1,
Node expr2)
"<"
|
static Node |
IR.memberFunctionDef(java.lang.String name,
Node function) |
static Node |
IR.name(java.lang.String name) |
static Node |
IR.ne(Node expr1,
Node expr2)
"!="
|
static Node |
IR.neg(Node expr1) |
static Node |
IR.newNode(Node target,
Node... args) |
static Node |
Node.newNumber(double number) |
static Node |
Node.newNumber(double number,
int lineno,
int charno) |
static Node |
Node.newString(java.lang.String str) |
static Node |
Node.newString(java.lang.String str,
int lineno,
int charno) |
static Node |
Node.newString(Token token,
java.lang.String str) |
static Node |
Node.newString(Token token,
java.lang.String str,
int lineno,
int charno) |
static Node |
Node.newTemplateLitString(java.lang.String cooked,
java.lang.String raw) |
static Node |
IR.not(Node expr1) |
static Node |
IR.nullNode() |
static Node |
IR.number(double d) |
static Node |
IR.objectlit(Node... propdefs) |
static Node |
IR.objectPattern(Node... keys) |
static Node |
IR.or(Node expr1,
Node expr2) |
static Node |
IR.paramList() |
static Node |
IR.paramList(Node... params) |
static Node |
IR.paramList(Node param) |
static Node |
IR.pos(Node expr1) |
static Node |
IR.propdef(Node string,
Node value) |
static Node |
IR.quotedStringKey(java.lang.String s,
Node value) |
static Node |
IR.regexp(Node expr) |
static Node |
IR.regexp(Node expr,
Node flags) |
Node |
Node.removeChildAfter(Node prev) |
Node |
Node.removeChildren() |
Node |
Node.removeFirstChild()
Removes the first child of Node.
|
Node |
Node.removeFirstOrChildAfter(Node prev)
Remove the child after the given child, or the first child if given null.
|
static Node |
IR.rest(Node target) |
static Node |
IR.returnNode() |
static Node |
IR.returnNode(Node expr) |
static Node |
IR.root(Node... rootChildren) |
static Node |
IR.script() |
static Node |
IR.script(java.util.List<Node> stmts) |
static Node |
IR.script(Node... stmts) |
Node |
Node.setJSDocInfo(JSDocInfo info)
Sets the
JSDocInfo attached to this node. |
Node |
Node.setJSType(JSType jstype) |
static Node |
IR.sheq(Node expr1,
Node expr2)
"==="
|
static Node |
IR.shne(Node expr1,
Node expr2)
"!=="
|
static Node |
IR.spread(Node expr) |
Node |
Node.srcref(Node other) |
Node |
Node.srcrefTree(Node other) |
static Node |
IR.string(java.lang.String s) |
static Node |
IR.stringKey(java.lang.String s) |
static Node |
IR.stringKey(java.lang.String s,
Node value) |
static Node |
IR.sub(Node expr1,
Node expr2) |
static Node |
IR.superNode() |
static Node |
IR.switchNode(Node cond,
Node... cases) |
static Node |
IR.thisNode() |
static Node |
IR.throwNode(Node expr) |
static Node |
IR.trueNode() |
static Node |
IR.tryCatch(Node tryBody,
Node catchNode) |
static Node |
IR.tryCatchFinally(Node tryBody,
Node catchNode,
Node finallyBody) |
static Node |
IR.tryFinally(Node tryBody,
Node finallyBody) |
static Node |
IR.typeof(Node expr) |
Node |
Node.useSourceInfoFrom(Node other)
Overwrite all the source information in this node with
that of
other . |
Node |
Node.useSourceInfoFromForTree(Node other)
Overwrite all the source information in this node and its subtree with
that of
other . |
Node |
Node.useSourceInfoIfMissingFrom(Node other)
Overwrite all the source information in this node with
that of
other iff the source info is missing. |
Node |
Node.useSourceInfoIfMissingFromForTree(Node other)
Overwrite all the source information in this node and its subtree with
that of
other iff the source info is missing. |
static Node |
IR.var(Node lhs) |
static Node |
IR.var(Node lhs,
Node value) |
static Node |
IR.voidNode(Node expr1) |
static Node |
IR.whileNode(Node cond,
Node body) |
static Node |
IR.yield() |
static Node |
IR.yield(Node expr) |
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<Node> |
Node.children()
Return an iterable object that iterates over this node's children.
|
java.util.Collection<Node> |
JSDocInfo.getTypeNodes()
Returns a collection of all type nodes that are a part of this JSDocInfo.
|
com.google.common.collect.ImmutableMap<java.lang.String,Node> |
JSDocInfo.getTypeTransformations()
Gets the type transformations.
|
java.util.Iterator<Node> |
Node.AncestorIterable.iterator() |
java.lang.Iterable<Node> |
Node.siblings()
Return an iterable object that iterates over this node's siblings,
including this Node but not any siblings that are before this one.
|
Modifier and Type | Method and Description |
---|---|
static Node |
IR.add(Node expr1,
Node expr2) |
void |
Node.addChildAfter(Node newChild,
Node node)
Add 'newChild' after 'node'.
|
void |
Node.addChildBefore(Node newChild,
Node node)
Add 'child' before 'node'.
|
void |
Node.addChildrenAfter(Node children,
Node node)
Add all children after 'node'.
|
void |
Node.addChildrenToBack(Node children) |
void |
Node.addChildrenToFront(Node children)
Add all children to the front of this node.
|
void |
Node.addChildToBack(Node child) |
void |
Node.addChildToFront(Node child) |
static Node |
IR.and(Node expr1,
Node expr2) |
static Node |
IR.arraylit(Node... exprs) |
static Node |
IR.arrayPattern(Node... keys) |
static Node.TypeDeclarationNode |
TypeDeclarationsIR.arrayType(Node elementType)
Represents an array type.
|
static Node |
IR.arrowFunction(Node name,
Node params,
Node body) |
static Node |
IR.assign(Node target,
Node expr) |
static Node |
IR.await(Node expr) |
static Node |
IR.block(Node... stmts) |
static Node |
IR.block(Node stmt) |
static Node |
IR.breakNode(Node name) |
static Node |
IR.call(Node target,
Node... args) |
static Node |
IR.call(Node target,
Node... args) |
static Node |
IR.caseNode(Node expr,
Node body) |
static Node |
IR.cast(Node expr1,
JSDocInfo jsdoc) |
static Node |
IR.catchNode(Node expr,
Node body) |
java.lang.String |
Node.checkTreeEquals(Node actual)
Checks if the subtree under this node is the same as another subtree.
|
java.lang.String |
Node.checkTreeEqualsIncludingJsDoc(Node actual)
Checks if the subtree under this node is the same as another subtree.
|
Node |
Node.clonePropsFrom(Node other)
Clone the properties from the provided node without copying
the property object.
|
static Node |
IR.comma(Node expr1,
Node expr2) |
static Node |
IR.computedProp(Node key,
Node value) |
static Node |
IR.constNode(Node lhs,
Node value) |
static Node |
IR.continueNode(Node name) |
static Node |
IR.dec(Node exp,
boolean isPost) |
static Node |
IR.declaration(Node lhs,
Node value,
Token type) |
static Node |
IR.declaration(Node lhs,
Token type) |
void |
NominalTypeBuilder.declareConstructorProperty(java.lang.String name,
JSType type,
Node defSite)
Declares a static property on the nominal type's constructor.
|
void |
NominalTypeBuilder.declareInstanceProperty(java.lang.String name,
JSType type,
Node defSite)
Declares an instance property on the nominal type.
|
void |
NominalTypeBuilder.declarePrototypeProperty(java.lang.String name,
JSType type,
Node defSite)
Declares a property on the nominal type's prototype.
|
static Node |
IR.defaultCase(Node body) |
static Node |
IR.delprop(Node target) |
static Node |
IR.doNode(Node body,
Node cond) |
static Node |
IR.eq(Node expr1,
Node expr2)
"=="
|
static Node |
IR.export(Node declaration) |
static Node |
IR.exprResult(Node expr) |
static Node |
IR.forIn(Node target,
Node cond,
Node body) |
static Node |
IR.forNode(Node init,
Node cond,
Node incr,
Node body) |
static Node |
IR.function(Node name,
Node params,
Node body) |
static Node.TypeDeclarationNode |
TypeDeclarationsIR.functionType(Node returnType,
java.util.LinkedHashMap<java.lang.String,Node.TypeDeclarationNode> requiredParams,
java.util.LinkedHashMap<java.lang.String,Node.TypeDeclarationNode> optionalParams,
java.lang.String restName,
Node.TypeDeclarationNode restType)
Represents a function type.
|
Node |
Node.getChildBefore(Node child) |
static Node |
IR.getelem(Node target,
Node elem) |
int |
Node.getIndexOfChild(Node child)
Gets the index of a child, note that this is O(N) where N is the number of children.
|
static Node |
IR.getprop(Node target,
Node prop) |
static Node |
IR.getprop(Node target,
Node prop,
Node... moreProps) |
static Node |
IR.getprop(Node target,
Node prop,
Node... moreProps) |
static Node |
IR.getprop(Node target,
java.lang.String prop,
java.lang.String... moreProps) |
boolean |
Node.hasChild(Node child) |
static Node |
IR.hook(Node cond,
Node trueval,
Node falseval) |
static Node |
IR.ifNode(Node cond,
Node then) |
static Node |
IR.ifNode(Node cond,
Node then,
Node elseNode) |
static Node |
IR.importNode(Node name,
Node importSpecs,
Node moduleIdentifier) |
static Node |
IR.in(Node expr1,
Node expr2) |
static Node |
IR.inc(Node exp,
boolean isPost) |
boolean |
Node.isDescendantOf(Node node) |
boolean |
Node.isEquivalentTo(Node node)
Returns true if this node is equivalent semantically to another
|
boolean |
Node.isEquivalentTo(Node node,
boolean compareType,
boolean recurse,
boolean jsDoc,
boolean sideEffect) |
boolean |
Node.isEquivalentToShallow(Node node)
Checks equivalence without going into child nodes
|
boolean |
Node.isEquivalentToTyped(Node node)
Returns true if this node is equivalent semantically to another and the types are equivalent.
|
boolean |
Node.isEquivalentWithSideEffectsTo(Node node)
Returns true if this node is equivalent semantically to another including side effects.
|
boolean |
Node.isEquivalentWithSideEffectsToShallow(Node node)
Returns true if this node is equivalent semantically to another including side effects.
|
boolean |
Node.isFirstChildOf(Node possibleParent) |
boolean |
Node.isOnlyChildOf(Node possibleParent) |
boolean |
Node.isSecondChildOf(Node possibleParent) |
static Node |
IR.label(Node name,
Node stmt) |
static Node |
IR.let(Node lhs,
Node value) |
static Node |
IR.lt(Node expr1,
Node expr2)
"<"
|
void |
JSDocInfoBuilder.markName(java.lang.String name,
Node templateNode,
int lineno,
int charno)
Adds a name declaration to the current marker.
|
void |
JSDocInfoBuilder.markTypeNode(Node typeNode,
int lineno,
int startCharno,
int endLineno,
int endCharno,
boolean hasLC)
Adds a type declaration to the current marker.
|
boolean |
Node.matchesQualifiedName(Node n)
Returns whether a node matches a simple or a qualified name, such as
x or
a.b.c or this.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.memberFunctionDef(java.lang.String name,
Node function) |
static Node |
IR.ne(Node expr1,
Node expr2)
"!="
|
static Node |
IR.neg(Node expr1) |
static Node |
IR.newNode(Node target,
Node... args) |
static Node |
IR.newNode(Node target,
Node... args) |
static Node |
IR.not(Node expr1) |
static Node |
IR.objectlit(Node... propdefs) |
static Node |
IR.objectPattern(Node... keys) |
static Node |
IR.or(Node expr1,
Node expr2) |
static Node |
IR.paramList(Node... params) |
static Node |
IR.paramList(Node param) |
static Node |
IR.pos(Node expr1) |
static Node |
IR.propdef(Node string,
Node value) |
static Node |
IR.quotedStringKey(java.lang.String s,
Node value) |
boolean |
JSDocInfoBuilder.recordTypeTransformation(java.lang.String name,
Node expr)
Records a type transformation expression together with its template
type name.
|
static Node |
IR.regexp(Node expr) |
static Node |
IR.regexp(Node expr,
Node flags) |
void |
Node.removeChild(Node child)
Detach a child from its parent and siblings.
|
Node |
Node.removeChildAfter(Node prev) |
Node |
Node.removeFirstOrChildAfter(Node prev)
Remove the child after the given child, or the first child if given null.
|
void |
Node.replaceChild(Node child,
Node newChild)
Detaches child from Node and replaces it with newChild.
|
void |
Node.replaceChildAfter(Node prevChild,
Node newChild) |
void |
Node.replaceFirstOrChildAfter(Node prev,
Node newChild)
Detaches the child after the given child, or the first child if prev is null.
|
void |
Node.replaceWith(Node newNode)
Detaches Node and replaces it with newNode.
|
static Node |
IR.rest(Node target) |
static Node |
IR.returnNode(Node expr) |
static Node |
IR.root(Node... rootChildren) |
static Node |
IR.script(Node... stmts) |
void |
Node.setStaticSourceFileFrom(Node other) |
static Node |
IR.sheq(Node expr1,
Node expr2)
"==="
|
static Node |
IR.shne(Node expr1,
Node expr2)
"!=="
|
static Node |
IR.spread(Node expr) |
Node |
Node.srcref(Node other) |
Node |
Node.srcrefTree(Node other) |
static Node |
IR.stringKey(java.lang.String s,
Node value) |
static Node |
IR.sub(Node expr1,
Node expr2) |
static Node |
IR.switchNode(Node cond,
Node... cases) |
static Node |
IR.switchNode(Node cond,
Node... cases) |
static Node |
IR.throwNode(Node expr) |
static Node |
IR.tryCatch(Node tryBody,
Node catchNode) |
static Node |
IR.tryCatchFinally(Node tryBody,
Node catchNode,
Node finallyBody) |
static Node |
IR.tryFinally(Node tryBody,
Node finallyBody) |
static Node |
IR.typeof(Node expr) |
Node |
Node.useSourceInfoFrom(Node other)
Overwrite all the source information in this node with
that of
other . |
Node |
Node.useSourceInfoFromForTree(Node other)
Overwrite all the source information in this node and its subtree with
that of
other . |
Node |
Node.useSourceInfoIfMissingFrom(Node other)
Overwrite all the source information in this node with
that of
other iff the source info is missing. |
Node |
Node.useSourceInfoIfMissingFromForTree(Node other)
Overwrite all the source information in this node and its subtree with
that of
other iff the source info is missing. |
static Node |
IR.var(Node lhs) |
static Node |
IR.var(Node lhs,
Node value) |
static Node |
IR.voidNode(Node expr1) |
static Node |
IR.whileNode(Node cond,
Node body) |
static Node |
IR.yield(Node expr) |
Modifier and Type | Method and Description |
---|---|
static Node |
IR.block(java.util.List<Node> stmts) |
static Node |
IR.script(java.util.List<Node> stmts) |
Constructor and Description |
---|
JSTypeExpression(Node root,
java.lang.String sourceName) |
Node(Token nodeType,
Node child) |
Node(Token nodeType,
Node child,
int lineno,
int charno) |
Node(Token nodeType,
Node left,
Node right) |
Node(Token nodeType,
Node left,
Node mid,
Node right) |
TypeDeclarationNode(Token nodeType,
Node child) |
Modifier and Type | Method and Description |
---|---|
Node |
FunctionParamBuilder.build() |
Node |
JSTypeRegistry.createOptionalParameters(JSType... parameterTypes)
Creates a tree hierarchy representing a typed parameter list in which
every parameter is optional.
|
Node |
JSTypeRegistry.createParameters(JSType... parameterTypes)
Creates a tree hierarchy representing a typed argument list.
|
Node |
JSTypeRegistry.createParametersWithVarArgs(JSType... parameterTypes)
Creates a tree hierarchy representing a typed argument list.
|
Node |
Property.getNode() |
Node |
SimpleReference.getNode() |
Node |
ObjectType.getOwnPropertyDefSite(java.lang.String propertyName) |
Node |
FunctionType.getParametersNode()
Gets a PARAM_LIST node that contains all params.
|
Node |
ObjectType.getPropertyDefSite(java.lang.String propertyName) |
Node |
ObjectType.getPropertyNode(java.lang.String propertyName)
Gets the node corresponding to the definition of the specified property.
|
Node |
FunctionType.getSource()
Gets the source node or null if this is an unknown function.
|
Node |
TemplateType.getTypeTransformation() |
Node |
FunctionParamBuilder.newOptionalParameterFromNode(Node n)
Copies the parameter specification from the given node,
but makes sure it's optional.
|
Node |
FunctionParamBuilder.newParameterFromNode(Node n)
Copies the parameter specification from the given node.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<Node> |
FunctionType.getParameters() |
Modifier and Type | Method and Description |
---|---|
RecordTypeBuilder |
RecordTypeBuilder.addProperty(java.lang.String name,
JSType type,
Node propertyNode)
Adds a property with the given name and type to the record type.
|
FunctionType |
JSTypeRegistry.createConstructorType(java.lang.String name,
Node source,
Node parameters,
JSType returnType,
com.google.common.collect.ImmutableList<TemplateType> templateKeys,
boolean isAbstract)
Creates a constructor function type.
|
EnumType |
JSTypeRegistry.createEnumType(java.lang.String name,
Node source,
JSType elementsType)
Creates an enum type.
|
FunctionType |
JSTypeRegistry.createFunctionType(JSType returnType,
Node parameters) |
FunctionType |
JSTypeRegistry.createInterfaceType(java.lang.String name,
Node source,
com.google.common.collect.ImmutableList<TemplateType> templateKeys,
boolean struct)
Creates an interface function type.
|
TemplateType |
JSTypeRegistry.createTemplateTypeWithTransformation(java.lang.String name,
Node expr) |
JSType |
JSTypeRegistry.createTypeFromCommentNode(Node n) |
JSType |
JSTypeRegistry.createTypeFromCommentNode(Node n,
java.lang.String sourceName,
StaticTypedScope scope)
Creates a JSType from the nodes representing a type.
|
void |
NominalTypeBuilderOti.declareConstructorProperty(java.lang.String name,
JSType type,
Node defSite) |
void |
NominalTypeBuilderOti.declareInstanceProperty(java.lang.String name,
JSType type,
Node defSite) |
void |
NominalTypeBuilderOti.declarePrototypeProperty(java.lang.String name,
JSType type,
Node defSite) |
boolean |
ObjectType.defineDeclaredProperty(java.lang.String propertyName,
JSType type,
Node propertyNode)
Defines a property whose type is explicitly declared by the programmer.
|
boolean |
EnumType.defineElement(java.lang.String name,
Node definingNode)
Defines a new element on this enum.
|
boolean |
ObjectType.defineInferredProperty(java.lang.String propertyName,
JSType type,
Node propertyNode)
Defines a property whose type is inferred.
|
boolean |
ObjectType.defineSynthesizedProperty(java.lang.String propertyName,
JSType type,
Node propertyNode)
Defines a property whose type is on a synthesized object.
|
java.lang.String |
JSTypeRegistry.getReadableTypeName(Node n)
The nice API for this method is a single argument; dereference is a detail.
|
java.lang.String |
JSTypeRegistry.getReadableTypeNameNoDeref(Node n) |
Node |
FunctionParamBuilder.newOptionalParameterFromNode(Node n)
Copies the parameter specification from the given node,
but makes sure it's optional.
|
Node |
FunctionParamBuilder.newParameterFromNode(Node n)
Copies the parameter specification from the given node.
|
void |
JSTypeRegistry.registerTemplateTypeNamesInScope(java.lang.Iterable<TemplateType> keys,
Node scopeRoot)
Registers template types on the given scope root.
|
void |
Property.setNode(Node n) |
void |
ObjectType.setPropertyNode(java.lang.String propertyName,
Node defSite)
Sets the node where the property was defined.
|
void |
PrototypeObjectType.setPropertyNode(java.lang.String propertyName,
Node defSite) |
void |
FunctionType.setSource(Node source)
Sets the source node.
|
FunctionBuilder |
FunctionBuilder.withParamsNode(Node parametersNode)
Set the parameters of the function type with a specially-formatted node.
|
FunctionBuilder |
FunctionBuilder.withSourceNode(Node sourceNode)
Set the source node of the function type.
|
Constructor and Description |
---|
SimpleReference(T symbol,
Node node) |
Copyright © 2009-2018 Google. All Rights Reserved.