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.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.
|
Modifier and Type | Field and Description |
---|---|
Node |
JSError.node
Node where the warning occurred.
|
protected Node |
Scope.rootNode |
Modifier and Type | Field and Description |
---|---|
protected Map<Node,com.google.javascript.jscomp.DefinitionSite> |
NameBasedDefinitionProvider.definitionNodeByDefinitionSite |
protected Set<Node> |
NameBasedDefinitionProvider.definitionNodes |
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 |
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) |
Node |
SyntheticAst.getAstRoot(AbstractCompiler compiler) |
Node |
CompilerInput.getAstRoot(AbstractCompiler compiler) |
Node |
CallGraph.Function.getBodyNode()
Returns the AST node for the body of the function.
|
static Node |
NodeUtil.getClassMembers(Node n) |
Node |
NodeTraversal.getCurrentNode()
Returns the node currently being traversed.
|
Node |
SymbolTable.Symbol.getDeclarationNode() |
static Node |
NodeUtil.getEnclosingBlock(Node n)
Finds the block containing the given node.
|
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.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 |
TypedVar.getInitialValue() |
Node |
Var.getInitialValue() |
Node |
JsMessageDefinition.getMessageNode() |
Node |
TypedVar.getNameNode() |
Node |
Var.getNameNode() |
static Node |
NodeUtil.getNameNode(Node n)
Gets the node of a function or class's name.
|
Node |
TypedVar.getNode() |
Node |
Var.getNode() |
static Node |
NodeUtil.getNodeByLineCol(Node ancestor,
int lineNo,
int columNo) |
Node |
TypedVar.getParentNode() |
Node |
Var.getParentNode() |
Node |
Compiler.getRoot() |
abstract Node |
AbstractCompiler.getRoot()
Returns the root node of the AST, which includes both externs and source.
|
Node |
Scope.getRootNode()
Gets the container node of the scope.
|
Node |
TypedScope.getRootNode() |
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 |
---|---|
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) |
void |
CheckConformance.Rule.check(NodeTraversal t,
Node n)
Perform conformance check
|
void |
ConformanceRules.AbstractRule.check(NodeTraversal t,
Node n) |
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.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.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,
Token type)
Checks a node's type.
|
static boolean |
NodeUtil.containsType(Node node,
Token type) |
static Node.TypeDeclarationNode |
JsdocToEs6TypedConverter.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.
|
SymbolTable.Symbol |
SymbolTable.declareInferredSymbol(SymbolTable.SymbolScope scope,
String name,
Node declNode)
Declare a symbol after the main symbol table was constructed.
|
static boolean |
CodingConventions.defaultIsFunctionCallThatAlwaysThrows(Node n,
String alwaysThrowsFunctionName) |
SymbolTable.Reference |
SymbolTable.Symbol.defineReferenceAt(Node n) |
CodingConvention.Cache |
CodingConventions.Proxy.describeCachingCall(Node node) |
CodingConvention.Cache |
ClosureCodingConvention.describeCachingCall(Node node) |
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.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.
|
void |
NodeTraversal.FunctionCallback.enterFunction(AbstractCompiler compiler,
Node fnRoot) |
abstract void |
NodeTraversal.AbstractModuleCallback.enterModule(NodeTraversal t,
Node scopeRoot)
Called immediately after entering a module.
|
void |
ClosureCheckModule.enterModule(NodeTraversal t,
Node scopeRoot) |
abstract void |
NodeTraversal.AbstractModuleCallback.exitModule(NodeTraversal t,
Node scopeRoot)
Called immediately before exiting a module.
|
void |
ClosureCheckModule.exitModule(NodeTraversal t,
Node scopeRoot) |
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.
|
static Node |
NodeUtil.getClassMembers(Node n) |
static int |
NodeUtil.getCount(Node n,
com.google.common.base.Predicate<Node> pred,
com.google.common.base.Predicate<Node> traverseChildrenPred) |
com.google.javascript.jscomp.DefinitionSite |
NameBasedDefinitionProvider.getDefinitionForFunction(Node function) |
Collection<com.google.javascript.jscomp.DefinitionsRemover.Definition> |
NameBasedDefinitionProvider.getDefinitionsReferencedAt(Node useSite) |
CodingConvention.DelegateRelationship |
CodingConventions.Proxy.getDelegateRelationship(Node callNode) |
CodingConvention.DelegateRelationship |
CodingConvention.getDelegateRelationship(Node callNode) |
static Node |
NodeUtil.getEnclosingBlock(Node n)
Finds the block containing the given node.
|
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.
|
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.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.
|
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 Node |
NodeUtil.getFunctionParameters(Node fnNode) |
static InputId |
NodeUtil.getInputId(Node n) |
static String |
NodeUtil.getName(Node n) |
static Node |
NodeUtil.getNameNode(Node n)
Gets the node of a function or class's name.
|
static String |
NodeUtil.getNearestFunctionName(Node n)
Gets the function's name.
|
static Node |
NodeUtil.getNodeByLineCol(Node ancestor,
int lineNo,
int columNo) |
static Double |
NodeUtil.getNumberValue(Node n) |
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.
|
protected static String |
NameBasedDefinitionProvider.getSimplifiedName(Node node)
Extract a name from a node.
|
String |
CodingConventions.Proxy.getSingletonGetterClassName(Node callNode) |
String |
ClosureCodingConvention.getSingletonGetterClassName(Node callNode) |
String |
ChromeCodingConvention.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) |
static String |
NodeUtil.getStringValue(Node n)
Gets the value of a node as a String, or null if it cannot be converted.
|
void |
AstValidator.ViolationHandler.handleViolation(String message,
Node n) |
static boolean |
NodeUtil.has(Node node,
com.google.common.base.Predicate<Node> pred,
com.google.common.base.Predicate<Node> traverseChildrenPred) |
void |
Es6ExtractClasses.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteBlockScopedDeclaration.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
DartSuperAccessorsPass.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
FieldCleanupPass.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6SplitVariableDeclarations.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteArrowFunction.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6ConvertSuper.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RenameVariablesInParamLists.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
RewriteAsyncFunctions.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
WhitespaceWrapGoogModules.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6ToEs3Converter.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
HotSwapCompilerPass.hotSwapScript(Node scriptRoot,
Node originalRoot)
Process the JS with root node root.
|
void |
Es6ConvertSuperConstructorCalls.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckRequiresForConstructors.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6TypedToEs6Converter.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteDestructuring.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6ToEs3ClassSideInheritance.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
ClosureCheckModule.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
Es6RewriteGenerators.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
RewritePolyfills.hotSwapScript(Node scriptRoot,
Node originalRoot) |
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 |
NodeUtil.isBooleanResult(Node n) |
static boolean |
NodeUtil.isCallOrNew(Node node) |
static boolean |
NodeUtil.isClassDeclaration(Node n)
|
boolean |
CodingConventions.Proxy.isClassFactoryCall(Node callNode) |
boolean |
ClosureCodingConvention.isClassFactoryCall(Node callNode) |
boolean |
GoogleCodingConvention.isClassFactoryCall(Node callNode) |
boolean |
CodingConvention.isClassFactoryCall(Node callNode)
Checks if the given method is a call to a class factory, such a factory returns a
unique class.
|
static boolean |
NodeUtil.isCompoundAssignementOp(Node n) |
static boolean |
NodeUtil.isControlStructure(Node n)
Determines whether the given node is a FOR, DO, WHILE, WITH, or IF node.
|
static boolean |
ControlFlowGraph.isEnteringNewCfgNode(Node n) |
static boolean |
NodeUtil.isExprCall(Node n)
Is this node a call expression statement?
|
boolean |
CodingConventions.Proxy.isFunctionCallThatAlwaysThrows(Node n) |
boolean |
ClosureCodingConvention.isFunctionCallThatAlwaysThrows(Node n) |
boolean |
ChromeCodingConvention.isFunctionCallThatAlwaysThrows(Node n) |
boolean |
CodingConvention.isFunctionCallThatAlwaysThrows(Node n)
Used by CheckMissingReturn.
|
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 |
CodingConventions.Proxy.isInlinableFunction(Node n) |
boolean |
CodingConvention.isInlinableFunction(Node n) |
static boolean |
NodeUtil.isLhsByDestructuring(Node n) |
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.isNameDeclaration(Node n)
Is this node a name declaration?
|
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) |
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.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.isPropertyTestFunction(Node call) |
boolean |
ClosureCodingConvention.isPropertyTestFunction(Node call) |
boolean |
JqueryCodingConvention.isPropertyTestFunction(Node call) |
boolean |
CodingConvention.isPropertyTestFunction(Node call)
Whether this CALL function is testing for the existence of a property.
|
boolean |
CodingConventions.Proxy.isPrototypeAlias(Node getProp) |
boolean |
JqueryCodingConvention.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) |
static boolean |
NodeUtil.isStatement(Node n) |
static boolean |
NodeUtil.isStatementBlock(Node n) |
static boolean |
NodeUtil.isStringResult(Node n) |
static boolean |
NodeUtil.isTopLevel(Node n) |
static boolean |
NodeUtil.isUndefined(Node n) |
boolean |
CodingConventions.Proxy.isVarArgsParameter(Node parameter) |
boolean |
GoogleCodingConvention.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 |
CallGraph.process(Node externsRoot,
Node jsRoot)
Builds a call graph for the given externsRoot and jsRoot.
|
void |
Es6ExtractClasses.process(Node externs,
Node root) |
void |
Es6RewriteBlockScopedDeclaration.process(Node externs,
Node root) |
void |
NameBasedDefinitionProvider.process(Node externs,
Node source) |
void |
JsdocToEs6TypedConverter.process(Node externs,
Node root) |
void |
ImplicitNullabilityCheck.process(Node externs,
Node root) |
void |
DartSuperAccessorsPass.process(Node externs,
Node root) |
void |
DefinitionUseSiteFinder.process(Node externs,
Node source) |
void |
CheckConformance.process(Node externs,
Node root) |
void |
J2clPropertyInlinerPass.process(Node externs,
Node root) |
void |
DeadPropertyAssignmentElimination.process(Node externs,
Node root) |
void |
ProcessCommonJSModules.process(Node externs,
Node root)
Module rewriting is done a on per-file basis prior to main compilation.
|
void |
TypeCheck.process(Node externsRoot,
Node jsRoot)
Main entry point for this phase of processing.
|
void |
FieldCleanupPass.process(Node externs,
Node root) |
void |
Es6SplitVariableDeclarations.process(Node externs,
Node root) |
void |
Es6RewriteArrowFunction.process(Node externs,
Node root) |
void |
J2clConstantHoisterPass.process(Node externs,
Node root) |
void |
J2clEqualitySameRewriterPass.process(Node externs,
Node root) |
void |
Es6ConvertSuper.process(Node externs,
Node root) |
void |
ExportTestFunctions.process(Node externs,
Node root) |
void |
AstValidator.process(Node externs,
Node root) |
void |
J2clChecksPass.process(Node externs,
Node root) |
void |
Es6RenameVariablesInParamLists.process(Node externs,
Node root) |
void |
J2clClinitPrunerPass.process(Node externs,
Node root) |
void |
RewriteAsyncFunctions.process(Node externs,
Node root) |
void |
WhitespaceWrapGoogModules.process(Node externs,
Node root) |
void |
Es6ToEs3Converter.process(Node externs,
Node root) |
void |
Es6ConvertSuperConstructorCalls.process(Node externs,
Node root) |
void |
CompilerPass.process(Node externs,
Node root)
Process the JS with root node root.
|
void |
CheckRequiresForConstructors.process(Node externs,
Node root) |
void |
ChromePass.process(Node externs,
Node root) |
void |
Es6TypedToEs6Converter.process(Node externs,
Node scriptRoot) |
void |
J2clPass.process(Node externs,
Node root) |
void |
TransformAMDToCJSModule.process(Node externs,
Node root) |
void |
Es6RewriteDestructuring.process(Node externs,
Node root) |
void |
Es6ToEs3ClassSideInheritance.process(Node externs,
Node root) |
void |
ClosureCheckModule.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 |
CheckEventfulObjectDisposal.process(Node externs,
Node root) |
void |
JsMessageVisitor.process(Node externs,
Node root) |
void |
Es6RewriteGenerators.process(Node externs,
Node root) |
void |
RewritePolyfills.process(Node externs,
Node root) |
void |
RemoveSuperMethodsPass.process(Node externs,
Node root) |
void |
ProcessEs6Modules.processFile(Node root,
boolean forceRewrite)
If a file contains an ES6 "import" or "export" statement, or the forceRewrite
option is true, rewrite the source as a module.
|
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.
|
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.
|
protected boolean |
ConformanceRules.AbstractRule.shouldCheckConformance(Node n) |
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 |
DartSuperAccessorsPass.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
CheckConformance.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
TypeCheck.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
ControlFlowGraph.AbstractCfgNodeTraversalCallback.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
Es6RewriteArrowFunction.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
RewriteAsyncFunctions.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
Es6ToEs3Converter.shouldTraverse(NodeTraversal t,
Node n,
Node parent)
Some nodes must be visited pre-order in order to rewrite the
references to
this correctly. |
boolean |
Es6ConvertSuperConstructorCalls.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
CheckRequiresForConstructors.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
Es6TypedToEs6Converter.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
Es6RewriteDestructuring.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)
Deprecated.
Use traverseEs6 whenever possible.
|
void |
NodeTraversal.traverse(Node root)
Traverses a parse tree recursively.
|
static void |
NodeTraversal.traverseEs6(AbstractCompiler compiler,
Node root,
NodeTraversal.Callback cb)
Traverses using the ES6SyntacticScopeCreator
|
void |
NodeTraversal.traverseFunctionOutOfBand(Node node,
Scope scope)
Traverse a function out-of-band of normal traversal.
|
static void |
NodeTraversal.traverseRoots(AbstractCompiler compiler,
NodeTraversal.Callback cb,
Node externs,
Node root)
Deprecated.
Use traverseRootsEs6.
|
static void |
NodeTraversal.traverseRootsEs6(AbstractCompiler compiler,
NodeTraversal.Callback cb,
Node externs,
Node root) |
static void |
NodeTraversal.traverseRootsTyped(AbstractCompiler compiler,
NodeTraversal.Callback cb,
Node externs,
Node root) |
static void |
NodeTraversal.traverseTyped(AbstractCompiler compiler,
Node root,
NodeTraversal.Callback cb) |
static boolean |
NodeUtil.tryMergeBlock(Node block)
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) |
static void |
NodeUtil.verifyScopeChanges(Map<Node,Node> map,
Node main,
boolean verifyUnchangedNodes)
Checks that the scope roots marked as changed have indeed changed
|
void |
NodeUtil.Visitor.visit(Node node) |
void |
Es6ExtractClasses.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RewriteBlockScopedDeclaration.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) |
void |
JsdocToEs6TypedConverter.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 |
DartSuperAccessorsPass.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckConformance.visit(NodeTraversal t,
Node n,
Node parent) |
void |
TypeCheck.visit(NodeTraversal t,
Node n,
Node parent)
This is the meat of the type checking.
|
void |
Es6SplitVariableDeclarations.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RewriteArrowFunction.visit(NodeTraversal t,
Node n,
Node parent) |
void |
J2clEqualitySameRewriterPass.visit(NodeTraversal t,
Node node,
Node parent) |
void |
Es6ConvertSuper.visit(NodeTraversal t,
Node n,
Node parent) |
void |
J2clChecksPass.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RenameVariablesInParamLists.visit(NodeTraversal t,
Node n,
Node parent) |
void |
RewriteAsyncFunctions.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6ToEs3Converter.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6ConvertSuperConstructorCalls.visit(NodeTraversal t,
Node n,
Node parent) |
void |
BranchCoverageInstrumentationCallback.visit(NodeTraversal traversal,
Node node,
Node parent) |
void |
CheckRequiresForConstructors.visit(NodeTraversal t,
Node n,
Node parent) |
void |
ChromePass.visit(NodeTraversal t,
Node node,
Node parent) |
void |
Es6TypedToEs6Converter.visit(NodeTraversal t,
Node n,
Node parent) |
void |
ProcessEs6Modules.visit(NodeTraversal t,
Node n,
Node parent) |
void |
Es6RewriteDestructuring.visit(NodeTraversal t,
Node n,
Node parent) |
void |
ClosureCheckModule.visit(NodeTraversal t,
Node n,
Node parent) |
void |
RewriteJsonToModule.visit(NodeTraversal t,
Node n,
Node parent) |
void |
JsMessageVisitor.visit(NodeTraversal traversal,
Node node,
Node parent) |
void |
Es6RewriteGenerators.visit(NodeTraversal t,
Node n,
Node parent) |
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 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) |
static void |
NodeUtil.verifyScopeChanges(Map<Node,Node> map,
Node main,
boolean verifyUnchangedNodes)
Checks that the scope roots marked as changed have indeed changed
|
static void |
NodeUtil.verifyScopeChanges(Map<Node,Node> map,
Node main,
boolean verifyUnchangedNodes)
Checks that the scope roots marked as changed have indeed changed
|
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) |
Scope(Node rootNode) |
SubclassRelationship(CodingConvention.SubclassType type,
Node subclassNode,
Node superclassNode) |
SyntheticAst(Node root) |
TemplateAstMatcher(TypeIRegistry 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 | Field and Description |
---|---|
static com.google.common.base.Function<Node,String> |
CheckRequiresAndProvidesSorted.getSortKey |
Modifier and Type | Method and Description |
---|---|
static boolean |
CheckNullableReturn.hasReturnDeclaredNullable(Node n) |
void |
CheckDuplicateCase.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckInterfaces.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckPrototypeProperties.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckPrimitiveAsObject.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckRequiresAndProvidesSorted.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckArrayWithGoogObject.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckNullableReturn.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckUselessBlocks.hotSwapScript(Node scriptRoot,
Node originalRoot) |
void |
CheckUnusedLabels.hotSwapScript(Node scriptRoot,
Node originalRoot) |
boolean |
CheckArrayWithGoogObject.isGoogObjectIterationOverArray(Node n) |
void |
CheckDuplicateCase.process(Node externs,
Node root) |
void |
CheckInterfaces.process(Node externs,
Node root) |
void |
CheckPrototypeProperties.process(Node externs,
Node root) |
void |
CheckMissingSemicolon.process(Node externs,
Node root) |
void |
CheckPrimitiveAsObject.process(Node externs,
Node root) |
void |
CheckRequiresAndProvidesSorted.process(Node externs,
Node root) |
void |
CheckArrayWithGoogObject.process(Node externs,
Node root) |
void |
CheckEnums.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 |
CheckUselessBlocks.process(Node externs,
Node root) |
void |
CheckUnusedLabels.process(Node externs,
Node root) |
boolean |
CheckPrototypeProperties.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
CheckNullableReturn.shouldTraverse(NodeTraversal nodeTraversal,
Node n,
Node parent) |
boolean |
CheckUselessBlocks.shouldTraverse(NodeTraversal t,
Node n,
Node parent) |
boolean |
CheckUnusedLabels.shouldTraverse(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 |
CheckPrototypeProperties.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckMissingSemicolon.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckPrimitiveAsObject.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckRequiresAndProvidesSorted.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckArrayWithGoogObject.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckEnums.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckEmptyStatements.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckJSDocStyle.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckNullableReturn.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckUselessBlocks.visit(NodeTraversal t,
Node n,
Node parent) |
void |
CheckUnusedLabels.visit(NodeTraversal t,
Node n,
Node parent) |
Modifier and Type | Method and Description |
---|---|
static boolean |
CheckNullableReturn.canReturnNull(ControlFlowGraph<Node> graph) |
Modifier and Type | Field and Description |
---|---|
protected Node |
Namespace.defSite |
Modifier and Type | Method and Description |
---|---|
Node |
NominalType.getDefSite() |
Node |
Namespace.getDefSite() |
Node |
JSType.getOwnPropertyDefSite(String propertyName) |
Node |
JSType.getPropertyDefSite(String propertyName) |
Node |
JSType.getSource() |
Modifier and Type | Method and Description |
---|---|
Map<Node,String> |
JSTypeCreatorFromJSDoc.getUnknownTypesMap() |
Modifier and Type | Method and Description |
---|---|
void |
RawNominalType.addClassProperty(String pname,
Node defSite,
JSType type,
boolean isConstant)
Add a new non-optional declared property to instances of this class
|
void |
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 |
RawNominalType.addProtoProperty(String pname,
Node defSite,
JSType type,
boolean isConstant)
Add a new declared prototype property to this class
|
void |
RawNominalType.addUndeclaredClassProperty(String pname,
JSType type,
Node defSite)
Add a new undeclared property to instances of this class
|
void |
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 |
RawNominalType.addUndeclaredProtoProperty(String pname,
Node defSite)
Add a new undeclared prototype property to this class
|
static QualifiedName |
QualifiedName.fromNode(Node qnameNode) |
JSTypeCreatorFromJSDoc.FunctionAndSlotType |
JSTypeCreatorFromJSDoc.getFunctionType(JSDocInfo jsdoc,
String functionName,
Node declNode,
RawNominalType constructorType,
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.
|
JSType |
JSTypeCreatorFromJSDoc.getTypeOfCommentNode(Node n,
RawNominalType ownerType,
DeclaredTypeRegistry registry) |
static EnumType |
EnumType.make(JSTypes commonTypes,
String name,
Node defSite,
JSTypeExpression typeExpr,
Collection<String> props) |
static RawNominalType |
RawNominalType.makeClass(JSTypes commonTypes,
Node defSite,
String name,
com.google.common.collect.ImmutableList<String> typeParameters,
ObjectKind objKind,
boolean isAbstract) |
static RawNominalType |
RawNominalType.makeNominalInterface(JSTypes commonTypes,
Node defSite,
String name,
com.google.common.collect.ImmutableList<String> typeParameters,
ObjectKind objKind) |
static RawNominalType |
RawNominalType.makeStructuralInterface(JSTypes commonTypes,
Node defSite,
String name,
com.google.common.collect.ImmutableList<String> typeParameters,
ObjectKind objKind) |
void |
JSType.setSource(Node n) |
Constructor and Description |
---|
FunctionNamespace(JSTypes commonTypes,
String name,
DeclaredTypeRegistry scope,
Node defSite) |
Namespace(JSTypes commonTypes,
String name,
Node defSite) |
NamespaceLit(JSTypes commonTypes,
String name,
Node defSite) |
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. |
Constructor and Description |
---|
ParseResult(Node ast,
List<Comment> comments,
FeatureSet features,
String sourceMap) |
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 |
ReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome)
Calculates a precise version of the scope knowing the outcome of the
condition.
|
FlowScope |
SemanticReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome) |
FlowScope |
ClosureReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome) |
protected JSType |
ChainableReverseAbstractInterpreter.getTypeIfRefinable(Node node,
FlowScope scope)
Returns the type of a node in the given scope if the node corresponds to a
name whose type is capable of being refined.
|
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.
|
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.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,
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.
|
String |
SuggestedFix.Builder.generateCode(AbstractCompiler compiler,
Node node) |
SuggestedFix.Builder |
SuggestedFix.Builder.insertAfter(Node node,
String text)
Inserts the text after the given 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 |
JsSourceMatcher.matches(Node n,
NodeMetadata metadata) |
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. |
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.replaceRange(Node first,
Node last,
String newContent)
Replaces a range of nodes with the given content.
|
Constructor and Description |
---|
JsSourceMatcher(TypeIRegistry 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 | 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.assign(Node target,
Node expr) |
static Node |
IR.await(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,
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) |
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.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 |
ObjectTypeI.getOwnPropertyDefSite(String propertyName) |
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,
String prop,
String... moreProps) |
Node |
ObjectTypeI.getPropertyDefSite(String propertyName) |
Node |
JSTypeExpression.getRoot() |
Node |
StaticScope.getRootNode()
Returns the root node associated with this scope.
|
Node |
Node.getSecondChild() |
Node |
FunctionTypeI.getSource()
Gets the AST Node where this function was defined.
|
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.let(Node lhs,
Node value) |
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(String str) |
static Node |
Node.newString(String str,
int lineno,
int charno) |
static Node |
Node.newString(Token token,
String str) |
static Node |
Node.newString(Token token,
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.
|
Node |
Node.removeFirstOrChildAfter(Node prev)
Remove the child after the given child, or the first child if given null.
|
static Node |
IR.rest(String name) |
static Node |
IR.returnNode() |
static Node |
IR.returnNode(Node expr) |
static Node |
IR.root(Node... rootChildren) |
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. |
Node |
Node.useSourceInfoWithoutLengthIfMissingFrom(Node other)
Deprecated.
|
Node |
Node.useSourceInfoWithoutLengthIfMissingFromForTree(Node other)
Deprecated.
|
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.
|
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 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 '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.TypeDeclarationNode |
TypeDeclarationsIR.arrayType(Node elementType)
Represents an array type.
|
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) |
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.computedProp(Node key,
Node value) |
static Node |
IR.constNode(Node lhs,
Node value) |
static Node |
IR.continueNode(Node name) |
TypeI |
TypeIRegistry.createTypeFromCommentNode(Node n) |
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.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) |
static Node.TypeDeclarationNode |
TypeDeclarationsIR.functionType(Node returnType,
LinkedHashMap<String,Node.TypeDeclarationNode> requiredParams,
LinkedHashMap<String,Node.TypeDeclarationNode> optionalParams,
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,
String prop,
String... moreProps) |
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.
|
boolean |
Node.isEquivalentWithSideEffectsTo(Node node)
Returns true if this node is equivalent semantically to another including side efffects.
|
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.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) |
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.returnNode(Node expr) |
static Node |
IR.root(Node... rootChildren) |
static Node |
IR.script(Node... stmts) |
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. |
Node |
Node.useSourceInfoWithoutLengthIfMissingFrom(Node other)
Deprecated.
|
Node |
Node.useSourceInfoWithoutLengthIfMissingFromForTree(Node other)
Deprecated.
|
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(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) |
TypeDeclarationNode(Token nodeType,
Node left,
Node right) |
TypeDeclarationNode(Token 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 |
SimpleReference.getNode() |
Node |
Property.getNode() |
Node |
ObjectType.getOwnPropertyDefSite(String propertyName) |
Node |
FunctionType.getParametersNode()
Gets an LP node that contains all params.
|
Node |
ObjectType.getPropertyDefSite(String propertyName) |
Node |
ObjectType.getPropertyNode(String propertyName)
Gets the node corresponding to the definition of the specified property.
|
Node |
ObjectType.getRootNode() |
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,
boolean isAbstract)
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,
boolean struct)
Creates an interface function type.
|
TemplateType |
JSTypeRegistry.createTemplateTypeWithTransformation(String name,
Node expr) |
JSType |
JSTypeRegistry.createTypeFromCommentNode(Node n) |
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) |
Copyright © 2009-2017 Google. All Rights Reserved.