Package | Description |
---|---|
com.google.javascript.jscomp |
Provides the core compiler and its public API.
|
com.google.javascript.jscomp.lint | |
com.google.javascript.jscomp.newtypes | |
com.google.javascript.jscomp.parsing |
Provides utilities to help with parsing JSDoc annotations and performing AST
transformations.
|
com.google.javascript.jscomp.testing | |
com.google.javascript.jscomp.type |
Provides type-checking data structures and algorithms.
|
com.google.javascript.refactoring | |
com.google.javascript.rhino |
The core AST from Rhino.
|
com.google.javascript.rhino.jstype |
Provides abstractions to represent types in JavaScript.
|
com.google.javascript.rhino.testing |
Modifier and Type | Field and Description |
---|---|
Node |
JSError.node
Node where the warning occurred.
|
protected Node |
Scope.rootNode |
Modifier and Type | Method and Description |
---|---|
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 |
CallGraph.Function.getAstNode()
Returns the underlying AST node for the function.
|
Node |
CallGraph.Callsite.getAstNode() |
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 |
CompilerInput.getAstRoot(AbstractCompiler compiler) |
Node |
CallGraph.Function.getBodyNode()
Returns the AST node for the body of the function.
|
Node |
NodeTraversal.getCurrentNode()
Returns the node currently being traversed.
|
Node |
SymbolTable.Symbol.getDeclarationNode() |
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.getEnclosingScript(Node n)
Finds the script containing the given node.
|
static Node |
NodeUtil.getEnclosingStatement(Node n) |
static Node |
NodeUtil.getFunctionParameters(Node fnNode) |
Node |
TypedVar.getInitialValue() |
Node |
Var.getInitialValue() |
Node |
JsMessageDefinition.getMessageNode() |
Node |
TypedVar.getNameNode() |
Node |
Var.getNameNode() |
Node |
TypedVar.getNode() |
Node |
Var.getNode() |
Node |
TypedVar.getParentNode() |
Node |
Var.getParentNode() |
Node |
Compiler.getRoot() |
Node |
TypedScope.getRootNode() |
Node |
Scope.getRootNode()
Gets the container node of the scope.
|
Node |
NodeTraversal.getScopeRoot()
Returns the current scope's root.
|
static Node |
NodeUtil.newPropertyAccess(AbstractCompiler compiler,
Node context,
String name)
Creates a property access on the
context tree. |
static Node |
NodeUtil.newQName(AbstractCompiler compiler,
String name)
Creates a node representing a qualified name.
|
static Node |
NodeUtil.newQNameDeclaration(AbstractCompiler compiler,
String name,
Node value,
JSDocInfo info)
Creates a node representing a qualified name.
|
Node |
Compiler.parse(SourceFile file) |
Modifier and Type | Method and Description |
---|---|
Collection<Node> |
SymbolTable.getAllJSDocInfoNodes() |
ControlFlowGraph<Node> |
NodeTraversal.getControlFlowGraph()
Gets the control flow graph for the current JS scope.
|
Map<String,Node> |
CompilerOptions.getDefineReplacements()
Returns the map of define replacements.
|
Map<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.
|
Map<String,Node> |
CompilerOptions.getTweakReplacements()
Returns the map of tweak replacements.
|
static Map<Node,Node> |
NodeUtil.mapMainToClone(Node main,
Node clone)
Given an AST and its copy, map the root node of each scope of main to the
corresponding root node of clone
|
static Map<Node,Node> |
NodeUtil.mapMainToClone(Node main,
Node clone)
Given an AST and its copy, map the root node of each scope of main to the
corresponding root node of clone
|
Modifier and Type | Method and Description |
---|---|
void |
SourceMap.addMapping(Node node,
FilePosition outputStartPosition,
FilePosition outputEndPosition) |
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.BanExpose.checkConformance(NodeTraversal t,
Node n) |
protected ConformanceRules.ConformanceResult |
ConformanceRules.BanThrowOfNonErrorTypes.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.BanUnresolvedType.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.NoImplicitlyPublicDecls.checkConformance(NodeTraversal t,
Node n) |
void |
CodingConventions.Proxy.checkForCallingConventionDefiningCalls(Node n,
Map<String,String> delegateCallingConventions) |
void |
CodingConvention.checkForCallingConventionDefiningCalls(Node n,
Map<String,String> delegateCallingConventions)
Checks for function calls that set the calling conventions on delegate
methods.
|
protected void |
JsMessageVisitor.checkNode(Node node,
int type)
Checks a node's type.
|
SymbolTable.Symbol |
SymbolTable.declareInferredSymbol(SymbolTable.SymbolScope scope,
String name,
Node declNode)
Declare a symbol after the main symbol table was constructed.
|
SymbolTable.Reference |
SymbolTable.Symbol.defineReferenceAt(Node n) |
CodingConvention.Bind |
CodingConventions.Proxy.describeFunctionBind(Node n) |
CodingConvention.Bind |
CodingConvention.describeFunctionBind(Node n)
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) |
CodingConvention.Bind |
CodingConvention.describeFunctionBind(Node n,
boolean callerChecksTypes,
boolean iCheckTypes)
A Bind instance or null.
|
String |
CodingConventions.Proxy.extractClassNameIfProvide(Node node,
Node parent) |
String |
ClosureCodingConvention.extractClassNameIfProvide(Node node,
Node parent)
Extracts X from goog.provide('X'), if the applied Node is goog.
|
String |
CodingConvention.extractClassNameIfProvide(Node node,
Node parent)
Convenience method for determining provided dependencies amongst different
JS scripts.
|
String |
CodingConventions.Proxy.extractClassNameIfRequire(Node node,
Node parent) |
String |
ClosureCodingConvention.extractClassNameIfRequire(Node node,
Node parent)
Extracts X from goog.require('X'), if the applied Node is goog.
|
String |
CodingConvention.extractClassNameIfRequire(Node node,
Node parent)
Convenience method for determining required dependencies amongst different
JS scripts.
|
boolean |
CodingConventions.Proxy.extractIsModuleFile(Node node,
Node parent) |
boolean |
ClosureCodingConvention.extractIsModuleFile(Node node,
Node parent) |
boolean |
CodingConvention.extractIsModuleFile(Node node,
Node parent)
Convenience method for determining if the node indicates the file
is a "module" file (a file whose top level symbols are not in global
scope).
|
JSType |
ClosureCodingConvention.AssertInstanceofSpec.getAssertedNewType(Node call,
DeclaredTypeRegistry scope) |
JSType |
ClosureCodingConvention.AssertFunctionByTypeName.getAssertedNewType(Node call,
DeclaredTypeRegistry scope) |
JSType |
CodingConvention.AssertionFunctionSpec.getAssertedNewType(Node call,
DeclaredTypeRegistry scope)
Returns the new type system type for a type assertion.
|
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) |
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.
|
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.
|
CallGraph.Callsite |
CallGraph.getCallsiteForAstNode(Node callsiteNode)
Returns the call graph Callsite object corresponding to the provided
AST Token.CALL or Token.NEW node, or null if no such object exists.
|
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.
|
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.DelegateRelationship |
CodingConventions.Proxy.getDelegateRelationship(Node callNode) |
CodingConvention.DelegateRelationship |
CodingConvention.getDelegateRelationship(Node callNode) |
static Node |
NodeUtil.getEnclosingFunction(Node n)
Finds the function containing the given node.
|
SymbolTable.SymbolScope |
SymbolTable.getEnclosingScope(Node n)
Gets the scope that contains the given node.
|
static Node |
NodeUtil.getEnclosingScript(Node n)
Finds the script containing the given node.
|
static Node |
NodeUtil.getEnclosingStatement(Node n) |
CallGraph.Function |
CallGraph.getFunctionForAstNode(Node functionNode)
Returns the call graph Function object corresponding to the provided
AST Token.FUNCTION node, or null if no such object exists.
|
static String |
NodeUtil.getFunctionName(Node n) |
static Node |
NodeUtil.getFunctionParameters(Node fnNode) |
static InputId |
NodeUtil.getInputId(Node n) |
static String |
NodeUtil.getNearestFunctionName(Node n)
Gets the function's name.
|
CodingConvention.ObjectLiteralCast |
CodingConventions.Proxy.getObjectLiteralCast(Node callNode) |
CodingConvention.ObjectLiteralCast |
ClosureCodingConvention.getObjectLiteralCast(Node callNode) |
CodingConvention.ObjectLiteralCast |
CodingConvention.getObjectLiteralCast(Node callNode)
Checks if the given method performs a object literal cast, and if it does,
returns information on the cast.
|
String |
CodingConventions.Proxy.getSingletonGetterClassName(Node callNode) |
String |
ClosureCodingConvention.getSingletonGetterClassName(Node callNode) |
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.
|
static StaticSourceFile |
NodeUtil.getSourceFile(Node n) |
static String |
NodeUtil.getSourceName(Node n) |
void |
AstValidator.ViolationHandler.handleViolation(String message,
Node n) |
void |
Es6RenameVariablesInParamLists.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteLetConst.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteGenerators.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
FieldCleanupPass.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6TypedToEs6Converter.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6ConvertSuper.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6ToEs3Converter.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6SplitVariableDeclarations.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
HotSwapCompilerPass.hotSwapScript(Node scriptRoot,
Node originalRoot)
Process the JS with root node root.
|
List<String> |
CodingConventions.Proxy.identifyTypeDeclarationCall(Node n) |
List<String> |
ClosureCodingConvention.identifyTypeDeclarationCall(Node n) |
List<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.
|
static boolean |
NodeUtil.isAssignmentOp(Node n) |
static boolean |
ControlFlowGraph.isEnteringNewCfgNode(Node n) |
static boolean |
NodeUtil.isForIn(Node n) |
boolean |
CodingConventions.Proxy.isFunctionCallThatAlwaysThrows(Node n) |
boolean |
ClosureCodingConvention.isFunctionCallThatAlwaysThrows(Node n) |
boolean |
CodingConvention.isFunctionCallThatAlwaysThrows(Node n)
Used by CheckMissingReturn.
|
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.isInFunction(Node n) |
boolean |
CodingConventions.Proxy.isInlinableFunction(Node n) |
boolean |
CodingConvention.isInlinableFunction(Node n) |
static boolean |
NodeUtil.isLValue(Node n)
Determines whether this node is used as an L-value.
|
static boolean |
NodeUtil.isNameDeclaration(Node n)
Is this node a name declaration?
|
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 |
CodingConventions.Proxy.isOptionalParameter(Node parameter) |
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 |
JqueryCodingConvention.isPropertyTestFunction(Node call) |
boolean |
CodingConventions.Proxy.isPropertyTestFunction(Node call) |
boolean |
ClosureCodingConvention.isPropertyTestFunction(Node call) |
boolean |
CodingConvention.isPropertyTestFunction(Node call)
Whether this CALL function is testing for the existence of a property.
|
boolean |
JqueryCodingConvention.isPrototypeAlias(Node getProp) |
boolean |
CodingConventions.Proxy.isPrototypeAlias(Node getProp) |
boolean |
CodingConvention.isPrototypeAlias(Node getProp)
Whether this GETPROP node is an alias for an object prototype.
|
static boolean |
NodeUtil.isPrototypePropertyDeclaration(Node n) |
boolean |
GoogleCodingConvention.isVarArgsParameter(Node parameter) |
boolean |
CodingConventions.Proxy.isVarArgsParameter(Node parameter) |
boolean |
CodingConvention.isVarArgsParameter(Node parameter)
This checks whether a given parameter should be treated as a marker
for a variable argument list function.
|
static JSError |
JSError.make(Node n,
CheckLevel level,
DiagnosticType type,
String... arguments) |
static JSError |
JSError.make(Node n,
DiagnosticType type,
String... arguments)
Creates a JSError from a file and Node position.
|
JSError |
NodeTraversal.makeError(Node n,
CheckLevel level,
DiagnosticType type,
String... arguments)
Creates a JSError during NodeTraversal.
|
JSError |
NodeTraversal.makeError(Node n,
DiagnosticType type,
String... arguments)
Creates a JSError during NodeTraversal.
|
static Map<Node,Node> |
NodeUtil.mapMainToClone(Node main,
Node clone)
Given an AST and its copy, map the root node of each scope of main to the
corresponding root node of clone
|
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 Node |
NodeUtil.newPropertyAccess(AbstractCompiler compiler,
Node context,
String name)
Creates a property access on the
context tree. |
static Node |
NodeUtil.newQNameDeclaration(AbstractCompiler compiler,
String name,
Node value,
JSDocInfo info)
Creates a node representing a qualified name.
|
void |
Es6RenameVariablesInParamLists.process(Node externs,
Node root) |
void |
ObjectPropertyStringPreprocess.process(Node externs,
Node root) |
void |
ProcessCommonJSModules.process(Node externs,
Node root) |
void |
CallGraph.process(Node externsRoot,
Node jsRoot)
Builds a call graph for the given externsRoot and jsRoot.
|
void |
Es6RewriteLetConst.process(Node externs,
Node root) |
void |
Es6RewriteGenerators.process(Node externs,
Node root) |
void |
Es6ToEs3ClassSideInheritance.process(Node externs,
Node root) |
void |
FieldCleanupPass.process(Node externs,
Node root) |
void |
Es6TypedToEs6Converter.process(Node externs,
Node root) |
void |
CheckConformance.process(Node externs,
Node root) |
void |
Es6ConvertSuper.process(Node externs,
Node root) |
void |
Es6ToEs3Converter.process(Node externs,
Node root) |
void |
ImplicitNullabilityCheck.process(Node externs,
Node root) |
void |
Es6SplitVariableDeclarations.process(Node externs,
Node root) |
void |
ConvertToTypedES6.process(Node externs,
Node root) |
void |
JsMessageVisitor.process(Node externs,
Node root) |
void |
AstValidator.process(Node externs,
Node root) |
void |
TypeCheck.process(Node externsRoot,
Node jsRoot)
Main entry point for this phase of processing.
|
void |
CheckEventfulObjectDisposal.process(Node externs,
Node root) |
void |
CompilerPass.process(Node externs,
Node root)
Process the JS with root node root.
|
void |
ConvertDeclaredTypesToJSDoc.process(Node externs,
Node scriptRoot) |
void |
ProcessEs6Modules.processFile(Node root) |
TypedScope |
TypeCheck.processForTesting(Node externsRoot,
Node jsRoot)
Main entry point of this phase for testing code.
|
void |
NodeTraversal.report(Node n,
DiagnosticType diagnosticType,
String... arguments)
Reports a diagnostic (error or warning)
|
protected void |
ConformanceRules.AbstractRule.report(NodeTraversal t,
Node n,
ConformanceRules.ConformanceResult result)
Report a conformance warning for the given node.
|
boolean |
Es6TypedToEs6Converter.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
Es6ConvertSuper.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
Es6ToEs3Converter.shouldTraverse(NodeTraversal t,
Node n,
Node parent)
Some nodes (such as arrow functions) must be visited pre-order in order to rewrite the
references to
this correctly. |
boolean |
TypeCheck.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
ControlFlowGraph.AbstractCfgNodeTraversalCallback.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.AbstractNodeTypePruningCallback.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
void |
Es6SplitVariableDeclarations.splitDeclaration(Node n,
Node parent) |
static 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.
|
String |
Compiler.toSource(Node n)
Generates JavaScript source code for an AST, doesn't generate source
map info.
|
abstract String |
AbstractCompiler.toSource(Node root)
Prints a node to source code.
|
static void |
NodeTraversal.traverse(AbstractCompiler compiler,
Node root,
NodeTraversal.Callback cb)
Traverses a node recursively.
|
void |
NodeTraversal.traverse(Node root)
Traverses a parse tree recursively.
|
void |
NodeTraversal.traverseFunctionOutOfBand(Node node,
Scope scope)
Traverse a function out-of-band of normal traversal.
|
protected void |
NodeTraversal.traverseInnerNode(Node node,
Node parent,
Scope refinedScope)
Traverses an inner node recursively with a refined scope.
|
static void |
NodeTraversal.traverseRoots(AbstractCompiler compiler,
NodeTraversal.Callback cb,
Node externs,
Node root) |
static void |
NodeTraversal.traverseTyped(AbstractCompiler compiler,
Node root,
NodeTraversal.Callback cb) |
void |
AstValidator.validateCodeRoot(Node n) |
void |
AstValidator.validateExpression(Node n) |
void |
AstValidator.validateRoot(Node n) |
void |
AstValidator.validateScript(Node n) |
void |
AstValidator.validateStatement(Node n) |
static void |
NodeUtil.verifyScopeChanges(Map<Node,Node> map,
Node main,
boolean verifyUnchangedNodes,
AbstractCompiler compiler)
Checks that the scope roots marked as changed have indeed changed
|
void |
NodeTraversal.FunctionCallback.visit(AbstractCompiler compiler,
Node fnRoot) |
void |
NodeUtil.Visitor.visit(Node node) |
void |
ProcessEs6Modules.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RenameVariablesInParamLists.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RewriteLetConst.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RewriteGenerators.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6ToEs3ClassSideInheritance.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6TypedToEs6Converter.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckConformance.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6ConvertSuper.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6ToEs3Converter.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 |
Es6SplitVariableDeclarations.visit(NodeTraversal t,
Node n,
Node parent) |
void |
ConvertToTypedES6.visit(NodeTraversal t,
Node n,
Node parent) |
void |
JsMessageVisitor.visit(NodeTraversal traversal,
Node node,
Node parent) |
void |
TypeCheck.visit(NodeTraversal t,
Node n,
Node parent)
This is the meat of the type checking.
|
void |
ConvertDeclaredTypesToJSDoc.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.AbstractPreOrderCallback.visit(NodeTraversal t,
Node n,
Node parent) |
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 void |
NodeUtil.verifyScopeChanges(Map<Node,Node> map,
Node main,
boolean verifyUnchangedNodes,
AbstractCompiler compiler)
Checks that the scope roots marked as changed have indeed changed
|
static void |
NodeUtil.verifyScopeChanges(Map<Node,Node> map,
Node main,
boolean verifyUnchangedNodes,
AbstractCompiler compiler)
Checks that the scope roots marked as changed have indeed changed
|
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.
|
Scope(Node rootNode) |
SubclassRelationship(CodingConvention.SubclassType type,
Node subclassNode,
Node superclassNode) |
SyntheticAst(Node root) |
TemplateAstMatcher(AbstractCompiler compiler,
Node templateFunctionNode)
Constructs this matcher with a Function node that serves as the template
to match all other nodes against.
|
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.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
CheckNullableReturn.hasReturnDeclaredNullable(Node n) |
void |
CheckInterfaces.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckPrototypeProperties.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckNullableReturn.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckInterfaces.process(Node externs,
Node root) |
void |
CheckPrototypeProperties.process(Node externs,
Node root) |
void |
CheckJSDoc.process(Node externs,
Node root) |
void |
CheckEnums.process(Node externs,
Node root) |
void |
CheckNullableReturn.process(Node externs,
Node root) |
boolean |
CheckPrototypeProperties.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
CheckNullableReturn.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
void |
CheckInterfaces.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckPrototypeProperties.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckJSDoc.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckEnums.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckNullableReturn.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 |
---|---|
Node |
NominalType.getDefsite() |
Node |
ObjectType.getPropDefsite(QualifiedName qname) |
Node |
NominalType.getPropDefsite(String pname) |
Modifier and Type | Method and Description |
---|---|
Map<Node,String> |
JSTypeCreatorFromJSDoc.getUnknownTypesMap() |
Modifier and Type | Method and Description |
---|---|
void |
NominalType.RawNominalType.addClassProperty(String pname,
Node defSite,
JSType type,
boolean isConstant)
Add a new non-optional declared property to instances of this class
|
void |
NominalType.RawNominalType.addCtorProperty(String pname,
Node defSite,
JSType type,
boolean isConstant)
Add a new non-optional declared property to this class's constructor
|
void |
Namespace.addProperty(String pname,
Node defSite,
JSType type,
boolean isConstant)
Add a new non-optional declared property to this namespace
|
void |
NominalType.RawNominalType.addProtoProperty(String pname,
Node defSite,
JSType type,
boolean isConstant)
Add a new non-optional declared prototype property to this class
|
void |
NominalType.RawNominalType.addUndeclaredClassProperty(String pname,
Node defSite)
Add a new undeclared property to instances of this class
|
void |
NominalType.RawNominalType.addUndeclaredCtorProperty(String pname,
Node defSite)
Add a new undeclared property to this class's constructor
|
void |
Namespace.addUndeclaredProperty(String pname,
Node defSite,
JSType t,
boolean isConstant)
Add a new undeclared property to this namespace
|
void |
NominalType.RawNominalType.addUndeclaredProtoProperty(String pname,
Node defSite)
Add a new undeclared prototype property to this class
|
static QualifiedName |
QualifiedName.fromNode(Node qnameNode) |
DeclaredFunctionType |
JSTypeCreatorFromJSDoc.getFunctionType(JSDocInfo jsdoc,
String functionName,
Node declNode,
NominalType.RawNominalType constructorType,
NominalType.RawNominalType ownerType,
DeclaredTypeRegistry registry)
Consumes either a "classic" function jsdoc with @param, @return, etc,
or a jsdoc with @type{function ...} and finds the types of the formal
parameters and the return value.
|
static NominalType.RawNominalType |
NominalType.RawNominalType.makeDictClass(Node defSite,
QualifiedName name,
com.google.common.collect.ImmutableList<String> typeParameters) |
static NominalType.RawNominalType |
NominalType.RawNominalType.makeInterface(Node defSite,
QualifiedName name,
com.google.common.collect.ImmutableList<String> typeParameters) |
static NominalType.RawNominalType |
NominalType.RawNominalType.makeStructClass(Node defSite,
QualifiedName name,
com.google.common.collect.ImmutableList<String> typeParameters) |
static NominalType.RawNominalType |
NominalType.RawNominalType.makeUnrestrictedClass(Node defSite,
QualifiedName name,
com.google.common.collect.ImmutableList<String> typeParameters) |
Modifier and Type | Field and Description |
---|---|
Node |
ParserRunner.ParseResult.ast |
Modifier and Type | Method and Description |
---|---|
Node |
TypeTransformationParser.getTypeTransformationAst() |
static Node |
JsDocInfoParser.parseTypeString(String typeString)
Parses a string containing a JsDoc type declaration, returning the
type if the parsing succeeded or
null if it failed. |
Modifier and Type | Method and Description |
---|---|
static Node.TypeDeclarationNode |
TypeDeclarationsIRFactory.arrayType(Node elementType)
Represents an array type.
|
static Node.TypeDeclarationNode |
TypeDeclarationsIRFactory.convertTypeNodeAST(Node n)
The root of a JSTypeExpression is very different from an AST node, even
though we use the same Java class to represent them.
|
static Node.TypeDeclarationNode |
TypeDeclarationsIRFactory.functionType(Node returnType,
LinkedHashMap<String,Node.TypeDeclarationNode> parameters,
String restName,
Node.TypeDeclarationNode restType)
Represents a function type.
|
static Node.TypeDeclarationNode |
TypeDeclarationsIRFactory.restParams(Node type)
Represents a function parameter type which may be repeated.
|
Constructor and Description |
---|
ParseResult(Node ast,
List<Comment> comments) |
Modifier and Type | Method and Description |
---|---|
static NodeSubject |
NodeSubject.assertNode(Node node) |
void |
NodeSubject.isEqualTo(Node node) |
Constructor and Description |
---|
NodeSubject(FailureStrategy fs,
Node node) |
Modifier and Type | Method and Description |
---|---|
protected void |
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 |
SemanticReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome) |
FlowScope |
ClosureReverseAbstractInterpreter.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.
|
void |
FlowScope.inferQualifiedSlot(Node node,
String symbol,
JSType bottomType,
JSType inferredType,
boolean declare)
Infer the type of a qualified name.
|
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.
|
Node |
SuggestedFix.getOriginalMatchedNode()
Returns the JS Compiler Node for the original node that caused this SuggestedFix to
be constructed.
|
Modifier and Type | Method and Description |
---|---|
Map<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,
String type)
Adds a cast of the given type to the provided node.
|
SuggestedFix.Builder |
SuggestedFix.Builder.addChildToFront(Node parentNode,
String content)
Inserts a new node as the first child of the provided node.
|
SuggestedFix.Builder |
SuggestedFix.Builder.addOrReplaceJsDoc(Node n,
String newJsDoc)
Adds or replaces the JS Doc for the given node.
|
SuggestedFix.Builder |
SuggestedFix.Builder.changeJsDocType(Node n,
AbstractCompiler compiler,
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.deleteWithoutRemovingSurroundWhitespace(Node n)
Deletes a node and its contents from the source file.
|
String |
SuggestedFix.Builder.generateCode(AbstractCompiler compiler,
Node node) |
SuggestedFix.Builder |
SuggestedFix.Builder.insertArguments(Node n,
int position,
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,
String content)
Inserts a string before the provided node.
|
boolean |
RefasterJsScanner.matches(Node node,
NodeMetadata metadata) |
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 |
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,
String name)
Renames a given node to the provided name.
|
SuggestedFix.Builder |
SuggestedFix.Builder.rename(Node n,
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.setOriginalMatchedNode(Node node)
Sets the node on this SuggestedFix that caused this SuggestedFix to be built
in the first place.
|
Constructor and Description |
---|
JsSourceMatcher(AbstractCompiler compiler,
Node templateNode)
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 | Class and Description |
---|---|
static class |
Node.TypeDeclarationNode
Represents a node in the type declaration AST.
|
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.assign(Node target,
Node expr) |
static Node |
IR.block() |
static Node |
IR.block(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) |
static Node |
IR.catchNode(Node expr,
Node body) |
Node |
Node.cloneNode() |
Node |
Node.clonePropsFrom(Node other)
Clone the properties from the provided node without copying
the property object.
|
Node |
Node.cloneTree() |
static Node |
IR.comma(Node expr1,
Node expr2) |
static Node |
IR.continueNode() |
static Node |
IR.continueNode(Node name) |
Node |
Node.copyInformationFrom(Node other)
Copies source file and name information from the other
node given to the current node.
|
Node |
Node.copyInformationFromForTree(Node other)
Copies source file and name information from the other node to the
entire tree rooted at this node.
|
static Node |
IR.dec(Node exp,
boolean isPost) |
static Node |
IR.declaration(Node lhs,
int type) |
static Node |
IR.declaration(Node lhs,
Node value,
int type) |
static Node |
IR.defaultCase(Node body) |
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.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) |
Node |
Node.getChildBefore(Node child) |
static Node |
IR.getelem(Node target,
Node elem) |
Node |
Node.getFirstChild() |
Node |
Node.getLastChild() |
Node |
Node.getLastSibling() |
Node |
Node.getNext() |
Node |
StaticRef.getNode()
The node where the reference lives.
|
Node |
Node.getParent() |
static Node |
IR.getprop(Node target,
Node prop) |
Node |
JSTypeExpression.getRoot() |
Node |
StaticScope.getRootNode()
Returns the root node associated with this scope.
|
Node |
FunctionTypeI.getSource() |
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.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(String name) |
static Node |
IR.lt(Node expr1,
Node expr2)
"<"
|
static Node |
IR.memberFunctionDef(String name,
Node function) |
static Node |
IR.name(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(int type,
String str) |
static Node |
Node.newString(int type,
String str,
int lineno,
int charno) |
static Node |
Node.newString(String str) |
static Node |
Node.newString(String str,
int lineno,
int charno) |
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.or(Node expr1,
Node expr2) |
static Node |
IR.paramList() |
static Node |
IR.paramList(List<Node> params) |
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.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.
|
static Node |
IR.rest(String name) |
static Node |
IR.returnNode() |
static Node |
IR.returnNode(Node expr) |
static Node |
IR.script() |
static Node |
IR.script(List<Node> stmts) |
static Node |
IR.script(Node... stmts) |
Node |
Node.setJSDocInfo(JSDocInfo info)
Sets the
JSDocInfo attached to this node. |
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(String s) |
static Node |
IR.stringKey(String s) |
static Node |
IR.stringKey(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) |
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 |
---|---|
Iterable<Node> |
Node.children()
Return an iterable object that iterates over this node's children.
|
SourcePosition<Node> |
JSDocInfo.Marker.getNameNode()
Gets the position information for the name found
in an @param tag.
|
Collection<Node> |
JSDocInfo.getTypeNodes()
Returns a collection of all type nodes that are a part of this JSDocInfo.
|
com.google.common.collect.ImmutableMap<String,Node> |
JSDocInfo.getTypeTransformations()
Gets the type transformations.
|
Iterator<Node> |
Node.AncestorIterable.iterator() |
Iterable<Node> |
Node.siblings()
Return an iterable object that iterates over this node's siblings,
including this Node.
|
Modifier and Type | Method and Description |
---|---|
static Node |
IR.add(Node expr1,
Node expr2) |
void |
Node.addChildAfter(Node newChild,
Node node)
Add 'child' 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) |
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.assign(Node target,
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) |
static Node |
IR.catchNode(Node expr,
Node body) |
String |
Node.checkTreeEquals(Node actual)
Checks if the subtree under this node is the same as another subtree.
|
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.continueNode(Node name) |
Node |
Node.copyInformationFrom(Node other)
Copies source file and name information from the other
node given to the current node.
|
Node |
Node.copyInformationFromForTree(Node other)
Copies source file and name information from the other node to the
entire tree rooted at this node.
|
TypeI |
TypeIRegistry.createTypeFromCommentNode(Node n,
String sourceName,
StaticTypedScope<? extends TypeI> scope) |
static Node |
IR.dec(Node exp,
boolean isPost) |
static Node |
IR.declaration(Node lhs,
int type) |
static Node |
IR.declaration(Node lhs,
Node value,
int type) |
static Node |
IR.defaultCase(Node body) |
static Node |
IR.doNode(Node body,
Node cond) |
static Node |
IR.eq(Node expr1,
Node expr2)
"=="
|
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) |
Node |
Node.getChildBefore(Node child) |
static Node |
IR.getelem(Node target,
Node elem) |
int |
Node.getIndexOfChild(Node child) |
static Node |
IR.getprop(Node target,
Node prop) |
String |
TypeIRegistry.getReadableTypeName(Node n) |
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.in(Node expr1,
Node expr2) |
static Node |
IR.inc(Node exp,
boolean isPost) |
boolean |
Node.isEquivalentTo(Node node)
Returns true if this node is equivalent semantically to another
|
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.
|
static Node |
IR.label(Node name,
Node stmt) |
static Node |
IR.lt(Node expr1,
Node expr2)
"<"
|
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 Node |
IR.memberFunctionDef(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.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) |
boolean |
JSDocInfoBuilder.recordTypeTransformation(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) |
void |
Node.replaceChild(Node child,
Node newChild)
Detaches child from Node and replaces it with newChild.
|
void |
Node.replaceChildAfter(Node prevChild,
Node newChild) |
static Node |
IR.returnNode(Node expr) |
static Node |
IR.script(Node... stmts) |
void |
Node.setDeclaredTypeExpression(Node typeExpression)
TODO(alexeagle): this should take a TypeDeclarationNode
|
void |
FunctionTypeI.setSource(Node n) |
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(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) |
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(List<Node> stmts) |
static Node |
IR.paramList(List<Node> params) |
static Node |
IR.script(List<Node> stmts) |
Constructor and Description |
---|
JSTypeExpression(Node root,
String sourceName) |
Node(int nodeType,
Node child) |
Node(int nodeType,
Node[] children) |
Node(int nodeType,
Node[] children,
int lineno,
int charno) |
Node(int nodeType,
Node child,
int lineno,
int charno) |
Node(int nodeType,
Node left,
Node right) |
Node(int nodeType,
Node left,
Node right,
int lineno,
int charno) |
Node(int nodeType,
Node left,
Node mid,
Node right) |
Node(int nodeType,
Node left,
Node mid,
Node right,
int lineno,
int charno) |
Node(int nodeType,
Node left,
Node mid,
Node mid2,
Node right) |
Node(int nodeType,
Node left,
Node mid,
Node mid2,
Node right,
int lineno,
int charno) |
TypeDeclarationNode(int nodeType,
Node child) |
TypeDeclarationNode(int nodeType,
Node left,
Node right) |
TypeDeclarationNode(int nodeType,
Node left,
Node mid,
Node right) |
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 |
JSTypeRegistry.createParametersWithVarArgs(List<JSType> parameterTypes)
Creates a tree hierarchy representing a typed argument list.
|
Node |
SimpleReference.getNode() |
Node |
Property.getNode() |
Node |
FunctionType.getParametersNode()
Gets an LP node that contains all params.
|
Node |
ObjectType.getPropertyNode(String propertyName)
Gets the node corresponding to the definition of the specified property.
|
Node |
ObjectType.getRootNode() |
Node |
EnumType.getSource()
Gets the source node or null if this is an unknown enum.
|
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 |
---|---|
Iterable<Node> |
FunctionType.getParameters() |
Modifier and Type | Method and Description |
---|---|
RecordTypeBuilder |
RecordTypeBuilder.addProperty(String name,
JSType type,
Node propertyNode)
Adds a property with the given name and type to the record type.
|
FunctionType |
JSTypeRegistry.createConstructorType(String name,
Node source,
Node parameters,
JSType returnType,
com.google.common.collect.ImmutableList<TemplateType> templateKeys)
Creates a constructor function type.
|
EnumType |
JSTypeRegistry.createEnumType(String name,
Node source,
JSType elementsType)
Creates an enum type.
|
FunctionType |
JSTypeRegistry.createFunctionType(JSType returnType,
Node parameters) |
FunctionType |
JSTypeRegistry.createInterfaceType(String name,
Node source,
com.google.common.collect.ImmutableList<TemplateType> templateKeys)
Creates an interface function type.
|
TemplateType |
JSTypeRegistry.createTemplateTypeWithTransformation(String name,
Node expr) |
JSType |
JSTypeRegistry.createTypeFromCommentNode(Node n,
String sourceName,
StaticTypedScope<? extends TypeI> scope)
Creates a JSType from the nodes representing a type.
|
boolean |
ObjectType.defineDeclaredProperty(String propertyName,
JSType type,
Node propertyNode)
Defines a property whose type is explicitly declared by the programmer.
|
boolean |
EnumType.defineElement(String name,
Node definingNode)
Defines a new element on this enum.
|
boolean |
ObjectType.defineInferredProperty(String propertyName,
JSType type,
Node propertyNode)
Defines a property whose type is inferred.
|
boolean |
ObjectType.defineSynthesizedProperty(String propertyName,
JSType type,
Node propertyNode)
Defines a property whose type is on a synthesized object.
|
String |
JSTypeRegistry.getReadableTypeName(Node n)
The nice API for this method is a single argument; dereference is a detail.
|
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 |
Property.setNode(Node n) |
void |
ObjectType.setPropertyNode(String propertyName,
Node defSite)
Sets the node where the property was defined.
|
void |
PrototypeObjectType.setPropertyNode(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) |
Modifier and Type | Method and Description |
---|---|
Node |
AbstractStaticScope.getRootNode() |
Modifier and Type | Method and Description |
---|---|
protected void |
BaseJSTypeTestCase.assertTypeEquals(JSType expected,
Node actual)
Asserts that a Node representing a type expression resolves to the
correct
JSType . |
Copyright © 2009-2015 Google. All Rights Reserved.