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.rhino |
The core AST from Rhino.
|
com.google.javascript.rhino.jstype |
Provides abstractions to represent types in JavaScript.
|
Modifier and Type | Field and Description |
---|---|
(package private) JSDocInfo |
ClosureRewriteClass.ClassDefinition.classInfo |
(package private) JSDocInfo |
GlobalNamespace.Name.docInfo |
private JSDocInfo |
SymbolTable.Symbol.docInfo |
(package private) JSDocInfo |
ClosureRewriteClass.MemberDefinition.info |
(package private) JSDocInfo |
PolymerPass.MemberDefinition.info
Any
JSDocInfo tied to this member. |
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,JSDocInfo> |
Es6ToEs3Converter.ClassDeclarationMetadata.classMembersToDeclare |
private java.util.Map<java.lang.String,JSDocInfo> |
Es6ToEs3Converter.ClassDeclarationMetadata.prototypeComputedPropsToDeclare |
private java.util.Map<java.lang.String,JSDocInfo> |
Es6ToEs3Converter.ClassDeclarationMetadata.prototypeMembersToDeclare |
Modifier and Type | Method and Description |
---|---|
private JSDocInfo |
ExternExportsPass.Export.buildEmptyJSDoc() |
(package private) static JSDocInfo |
NodeUtil.createConstantJsDoc() |
static JSDocInfo |
NodeUtil.getBestJSDocInfo(Node n)
Find the best JSDoc for the given node.
|
private static JSDocInfo |
GlobalNamespace.Name.getDocInfoForDeclaration(GlobalNamespace.Ref ref)
Tries to get the doc info for a given declaration ref.
|
JSDocInfo |
GlobalNamespace.Name.getJSDocInfo() |
JSDocInfo |
SymbolTable.Symbol.getJSDocInfo() |
JSDocInfo |
TypedVar.getJSDocInfo() |
JSDocInfo |
Var.getJSDocInfo() |
private JSDocInfo |
PureFunctionIdentifier.FunctionAnalyzer.getJSDocInfoForFunction(Node node,
Node parent,
Node gramp)
Get the doc info associated with the function.
|
private JSDocInfo |
ClosureRewriteClass.mergeJsDocFor(ClosureRewriteClass.ClassDefinition cls,
Node associatedNode) |
Modifier and Type | Method and Description |
---|---|
private static void |
InferJSDocInfo.attachJSDocInfoToNominalTypeOrShape(ObjectType objType,
JSDocInfo docInfo,
java.lang.String qName)
Handle cases #1 and #3 in the class doc.
|
private void |
TypeCheck.checkDeclaredPropertyInheritance(NodeTraversal t,
Node n,
FunctionType ctorType,
java.lang.String propertyName,
JSDocInfo info,
JSType propertyType)
Given a constructor type and a property name, check that the property has
the JSDoc annotation @override iff the property is declared on a
superclass.
|
private void |
TypeCheck.checkEnumAlias(NodeTraversal t,
JSDocInfo declInfo,
Node value)
Checks enum aliases.
|
private void |
CollapseProperties.checkForHosedThisReferences(Node function,
JSDocInfo docInfo,
GlobalNamespace.Name name)
Warns about any references to "this" in the given FUNCTION.
|
private void |
TypedScopeCreator.GlobalScopeBuilder.checkForTypedef(Node candidate,
JSDocInfo info)
Handle typedefs.
|
private void |
TypeCheck.checkPropertyInheritanceOnGetpropAssign(NodeTraversal t,
Node assign,
Node object,
java.lang.String property,
JSDocInfo info,
JSType propertyType) |
private java.util.ArrayList<java.lang.String> |
GlobalTypeInfo.CollectNamedTypes.collectFormals(Node fn,
JSDocInfo fnDoc) |
private DeclaredFunctionType |
GlobalTypeInfo.ProcessScope.computeFnDeclaredType(JSDocInfo fnDoc,
java.lang.String functionName,
Node declNode,
RawNominalType ownerType,
NTIScope parentScope) |
private EnumType |
TypedScopeCreator.AbstractScopeBuilder.createEnumTypeFromNodes(Node rValue,
java.lang.String name,
JSDocInfo info)
Creates a new enum type, based on the given nodes.
|
private FunctionType |
TypedScopeCreator.AbstractScopeBuilder.createFunctionTypeFromNodes(Node rValue,
java.lang.String name,
JSDocInfo info,
Node lvalueNode)
Creates a new function type, based on the given nodes.
|
private SymbolTable.Symbol |
SymbolTable.declareSymbol(java.lang.String name,
JSType type,
boolean inferred,
SymbolTable.SymbolScope scope,
Node declNode,
JSDocInfo info) |
private void |
TypedScopeCreator.AbstractScopeBuilder.defineName(Node name,
Node var,
JSDocInfo info)
Defines a variable based on the
Token.NAME node passed. |
private void |
RewritePolyfills.Traverser.fixJsdoc(Scope scope,
JSDocInfo doc) |
(package private) JSType |
TypedScopeCreator.AbstractScopeBuilder.getDeclaredType(JSDocInfo info,
Node lValue,
Node rValue)
Look for a type declaration on a property assignment
(in an ASSIGN or an object literal key).
|
private JSType |
TypedScopeCreator.AbstractScopeBuilder.getDeclaredTypeInAnnotation(Node node,
JSDocInfo info)
Returns the type specified in a JSDoc annotation near a GETPROP or NAME.
|
private JSType |
GlobalTypeInfo.getDeclaredTypeOfNode(JSDocInfo jsdoc,
NTIScope s) |
(package private) GlobalTypeInfo.PropertyType |
GlobalTypeInfo.ProcessScope.getPropTypeHelper(JSDocInfo jsdoc,
Node initializer,
RawNominalType thisType) |
private boolean |
CheckJSDoc.hasClassLevelJsDoc(JSDocInfo info) |
private boolean |
PureFunctionIdentifier.FunctionAnalyzer.hasNoSideEffectsAnnotation(JSDocInfo docInfo)
Get the value of the @nosideeffects annotation stored in the
doc info.
|
private boolean |
PureFunctionIdentifier.FunctionAnalyzer.hasSideEffectsArgumentsAnnotation(JSDocInfo docInfo) |
private boolean |
PureFunctionIdentifier.FunctionAnalyzer.hasSideEffectsThisAnnotation(JSDocInfo docInfo)
Get the value of the @modifies{this} annotation stored in the
doc info.
|
private void |
TypedScopeCreator.DiscoverEnumsAndTypedefs.identifyNameNode(Node nameNode,
JSDocInfo info) |
(package private) FunctionTypeBuilder |
FunctionTypeBuilder.inferInheritance(JSDocInfo info)
Infer the role of the function (whether it's a constructor or interface)
and what it inherits from in JSDocInfo.
|
(package private) FunctionTypeBuilder |
FunctionTypeBuilder.inferParameterTypes(JSDocInfo info)
Infer the parameter types from the doc info alone.
|
(package private) FunctionTypeBuilder |
FunctionTypeBuilder.inferParameterTypes(Node argsParent,
JSDocInfo info)
Infer the parameter types from the list of argument names and
the doc info.
|
(package private) FunctionTypeBuilder |
FunctionTypeBuilder.inferReturnType(JSDocInfo info,
boolean fromInlineDoc)
Infer the return type from JSDocInfo.
|
(package private) FunctionTypeBuilder |
FunctionTypeBuilder.inferTemplateTypeName(JSDocInfo info,
JSType ownerType)
Infer the template type from the doc info.
|
(package private) FunctionTypeBuilder |
FunctionTypeBuilder.inferThisType(JSDocInfo info)
Infers the type of
this . |
(package private) FunctionTypeBuilder |
FunctionTypeBuilder.inferThisType(JSDocInfo info,
JSType type)
Infers the type of
this . |
(package private) static boolean |
NodeUtil.isConstantDeclaration(CodingConvention convention,
JSDocInfo info,
Node node)
Temporary function to determine if a node is constant
in the old or new world.
|
(package private) static boolean |
FunctionTypeBuilder.isFunctionTypeDeclaration(JSDocInfo info)
Determines whether the given JsDoc info declares a function type.
|
private boolean |
FunctionTypeBuilder.isOptionalParameter(Node param,
JSDocInfo info) |
private boolean |
TypedScopeCreator.AbstractScopeBuilder.isQualifiedNameInferred(java.lang.String qName,
Node n,
JSDocInfo info,
Node rhsValue,
JSType valueType)
Determines whether a qualified name is inferred.
|
private boolean |
FunctionTypeBuilder.isVarArgsParameter(Node param,
JSDocInfo info)
Determine whether this is a var args parameter.
|
(package private) void |
TypedScopeCreator.AbstractScopeBuilder.maybeDeclareQualifiedName(NodeTraversal t,
JSDocInfo info,
Node n,
Node parent,
Node rhsValue)
Declare the symbol for a qualified name in the global scope.
|
(package private) void |
TypedScopeCreator.GlobalScopeBuilder.maybeDeclareQualifiedName(NodeTraversal t,
JSDocInfo info,
Node n,
Node parent,
Node rhsValue) |
private void |
GlobalTypeInfo.CollectNamedTypes.maybeRecordNominalType(Node defSite,
Node nameNode,
JSDocInfo fnDoc,
boolean isRedeclaration) |
private void |
InlineAliases.AliasesInliner.maybeRewriteJsdoc(JSDocInfo info) |
static Node |
NodeUtil.newQNameDeclaration(AbstractCompiler compiler,
java.lang.String name,
Node value,
JSDocInfo info)
Creates a node representing a qualified name.
|
static java.lang.String |
JSDocInfoPrinter.print(JSDocInfo info) |
(package private) void |
SymbolTable.Symbol.setJSDocInfo(JSDocInfo info) |
private boolean |
TypedScopeCreator.AbstractScopeBuilder.shouldUseFunctionLiteralType(FunctionType type,
JSDocInfo info,
Node lValue)
If a variable is assigned a function literal in the global scope,
make that a declared type (even if there's no doc info).
|
private boolean |
GlobalTypeInfo.ProcessScope.suppressDupPropWarning(JSDocInfo propCreationJsdoc,
JSType typeInJsdoc,
JSType previousType) |
private void |
CheckJSDoc.validateClassLevelJsDoc(Node n,
JSDocInfo info)
Checks that class-level annotations like @interface/@extends are not used on member functions.
|
private void |
CheckJSDoc.validateDefaultValue(Node n,
JSDocInfo info)
Check that an arrow function is not annotated with .
|
private void |
CheckJSDoc.validateDeprecatedJsDoc(Node n,
JSDocInfo info)
Checks that deprecated annotations such as @expose are not present
|
private void |
CheckJSDoc.validateFunctionJsDoc(Node n,
JSDocInfo info)
Checks that JSDoc intended for a function is actually attached to a
function.
|
private void |
CheckJSDoc.validateMsgJsDoc(Node n,
JSDocInfo info)
Checks that annotations for messages (
@desc , @hidden ,
and @meaning )
are in the proper place, namely on names starting with MSG_ which
indicates they should be
extracted for translation. |
private void |
CheckJSDoc.validateNoCollapse(Node n,
JSDocInfo info)
Warns when nocollapse annotations are present on nodes
which are not eligible for property collapsing.
|
private void |
CheckJSDoc.validateNoSideEffects(Node n,
JSDocInfo info)
Check that @nosideeeffects annotations are only present in externs.
|
private void |
CheckJSDoc.validateTempates(Node n,
JSDocInfo info) |
private void |
CheckJSDoc.validateTypeAnnotations(Node n,
JSDocInfo info)
Check that JSDoc with a
@type annotation is in a valid place. |
private static ConformanceRules.ConformanceResult |
ConformanceRules.NoImplicitlyPublicDecls.visibilityAtDeclarationOrFileoverview(JSDocInfo declaredJsDoc,
Node scriptNode) |
private void |
InlineAliases.AliasesCollector.visitAliasDefinition(Node lhs,
JSDocInfo info)
Maybe record that given lvalue is an alias of the qualified name on its rhs.
|
Constructor and Description |
---|
ClassDefinition(Node name,
JSDocInfo classInfo,
Node superClass,
ClosureRewriteClass.MemberDefinition constructor,
java.util.List<ClosureRewriteClass.MemberDefinition> staticProps,
java.util.List<ClosureRewriteClass.MemberDefinition> props,
Node classModifier) |
MemberDefinition(JSDocInfo info,
Node name,
Node value) |
MemberDefinition(JSDocInfo info,
Node name,
Node value) |
PolymerClassDefinition(Node target,
Node descriptor,
JSDocInfo classInfo,
PolymerPass.MemberDefinition constructor,
java.lang.String nativeBaseElement,
java.util.List<PolymerPass.MemberDefinition> props,
com.google.common.collect.ImmutableList<PolymerBehaviorExtractor.BehaviorDefinition> behaviors) |
Modifier and Type | Method and Description |
---|---|
private void |
CheckJSDocStyle.checkParams(NodeTraversal t,
Node function,
JSDocInfo jsDoc) |
private void |
CheckJSDocStyle.checkReturn(NodeTraversal t,
Node function,
JSDocInfo jsDoc) |
private void |
CheckJSDocStyle.checkSuppressionsOnNonFunction(NodeTraversal t,
Node n,
JSDocInfo jsDoc) |
Modifier and Type | Method and Description |
---|---|
private void |
JSTypeCreatorFromJSDoc.fillInFormalParameterTypes(JSDocInfo jsdoc,
Node funNode,
com.google.common.collect.ImmutableList<java.lang.String> typeParameters,
DeclaredTypeRegistry registry,
FunctionTypeBuilder builder,
boolean ignoreJsdoc) |
private void |
JSTypeCreatorFromJSDoc.fillInReturnType(JSDocInfo jsdoc,
Node funNode,
Node parent,
com.google.common.collect.ImmutableList<java.lang.String> typeParameters,
DeclaredTypeRegistry registry,
FunctionTypeBuilder builder,
boolean ignoreJsdoc) |
private JSType |
JSTypeCreatorFromJSDoc.getDeclaredTypeOfNode(JSDocInfo jsdoc,
DeclaredTypeRegistry registry,
com.google.common.collect.ImmutableList<java.lang.String> typeParameters) |
JSType |
JSTypeCreatorFromJSDoc.getDeclaredTypeOfNode(JSDocInfo jsdoc,
RawNominalType ownerType,
DeclaredTypeRegistry registry) |
private com.google.common.collect.ImmutableSet<NominalType> |
JSTypeCreatorFromJSDoc.getExtendedInterfaces(JSDocInfo jsdoc,
DeclaredTypeRegistry registry,
com.google.common.collect.ImmutableList<java.lang.String> typeParameters) |
JSTypeCreatorFromJSDoc.FunctionAndSlotType |
JSTypeCreatorFromJSDoc.getFunctionType(JSDocInfo jsdoc,
java.lang.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.
|
private DeclaredFunctionType |
JSTypeCreatorFromJSDoc.getFunTypeFromTypicalFunctionJsdoc(JSDocInfo jsdoc,
java.lang.String functionName,
Node funNode,
RawNominalType constructorType,
RawNominalType ownerType,
DeclaredTypeRegistry registry,
FunctionTypeBuilder builder) |
private com.google.common.collect.ImmutableSet<NominalType> |
JSTypeCreatorFromJSDoc.getImplementedInterfaces(JSDocInfo jsdoc,
DeclaredTypeRegistry registry,
com.google.common.collect.ImmutableList<java.lang.String> typeParameters) |
private com.google.common.collect.ImmutableSet<NominalType> |
JSTypeCreatorFromJSDoc.getInterfacesHelper(JSDocInfo jsdoc,
DeclaredTypeRegistry registry,
com.google.common.collect.ImmutableList<java.lang.String> typeParameters,
boolean implementedIntfs) |
private NominalType |
JSTypeCreatorFromJSDoc.getMaybeParentClass(JSDocInfo jsdoc,
java.lang.String functionName,
Node funNode,
com.google.common.collect.ImmutableList<java.lang.String> typeParameters,
DeclaredTypeRegistry registry) |
private void |
JSTypeCreatorFromJSDoc.handleInterfaceAnnotation(JSDocInfo jsdoc,
java.lang.String functionName,
Node funNode,
RawNominalType constructorType,
com.google.common.collect.ImmutableSet<NominalType> implementedIntfs,
com.google.common.collect.ImmutableList<java.lang.String> typeParameters,
DeclaredTypeRegistry registry,
FunctionTypeBuilder builder) |
static boolean |
JSTypeCreatorFromJSDoc.isRestArg(JSDocInfo funJsdoc,
java.lang.String formalParamName) |
Constructor and Description |
---|
ParamIterator(Node params,
JSDocInfo jsdoc) |
Modifier and Type | Field and Description |
---|---|
(package private) JSDocInfo |
IRFactory.fileOverviewInfo |
private JSDocInfo |
JsDocInfoParser.fileOverviewJSDocInfo |
Modifier and Type | Method and Description |
---|---|
(package private) JSDocInfo |
JsDocInfoParser.getFileOverviewJSDocInfo()
Gets the fileoverview JSDocInfo, if any.
|
private JSDocInfo |
IRFactory.handleInlineJsDoc(ParseTree node) |
private JSDocInfo |
IRFactory.handleInlineJsDoc(SourceRange location) |
private JSDocInfo |
IRFactory.handleInlineJsDoc(Token token) |
private JSDocInfo |
IRFactory.handleJsDoc(Comment comment) |
private JSDocInfo |
IRFactory.handleJsDoc(ParseTree node) |
private JSDocInfo |
IRFactory.handleJsDoc(Token token) |
JSDocInfo |
JsDocInfoParser.parseInlineTypeDoc()
Parse a description as a
@type . |
private JSDocInfo |
IRFactory.parseInlineTypeDoc(Comment node)
Parses inline type info.
|
static JSDocInfo |
JsDocInfoParser.parseJsdoc(java.lang.String toParse)
Parses a string containing a JsDoc declaration, returning the entire JSDocInfo
if the parsing succeeded or
null if it failed. |
private JSDocInfo |
IRFactory.recordJsDoc(SourceRange location,
JSDocInfo info) |
(package private) JSDocInfo |
JsDocInfoParser.retrieveAndResetParsedJSDocInfo() |
Modifier and Type | Method and Description |
---|---|
private Node |
IRFactory.maybeInjectCastNode(ParseTree node,
JSDocInfo info,
Node irNode) |
private JSDocInfo |
IRFactory.recordJsDoc(SourceRange location,
JSDocInfo info) |
(package private) void |
JsDocInfoParser.setFileOverviewJSDocInfo(JSDocInfo fileOverviewJSDocInfo)
Sets the file overview JSDocInfo, in order to warn about multiple uses of
the @fileoverview tag in a file.
|
Modifier and Type | Field and Description |
---|---|
private JSDocInfo |
JSDocInfoBuilder.currentInfo |
Modifier and Type | Method and Description |
---|---|
JSDocInfo |
JSDocInfoBuilder.build()
Builds a
JSDocInfo object based on the populated information and
returns it. |
JSDocInfo |
JSDocInfoBuilder.build(boolean always)
Builds a
JSDocInfo object based on the populated information and
returns it. |
JSDocInfo |
JSDocInfoBuilder.buildAndReset()
Builds a
JSDocInfo object based on the populated information and
returns it. |
JSDocInfo |
JSDocInfo.clone() |
JSDocInfo |
Node.getJSDocInfo()
Get the
JSDocInfo attached to this node. |
JSDocInfo |
StaticSlot.getJSDocInfo()
Gets the JSDoc for this slot.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
JSDocInfo.areEquivalent(JSDocInfo jsDoc1,
JSDocInfo jsDoc2) |
static Node |
IR.cast(Node expr1,
JSDocInfo jsdoc) |
static JSDocInfoBuilder |
JSDocInfoBuilder.copyFrom(JSDocInfo info) |
static JSDocInfoBuilder |
JSDocInfoBuilder.maybeCopyFrom(JSDocInfo info) |
(package private) void |
JSDocInfo.mergePropertyBitfieldFrom(JSDocInfo other) |
void |
JSDocInfoBuilder.mergePropertyBitfieldFrom(JSDocInfo other) |
private static void |
JSDocInfoBuilder.populateDefaults(JSDocInfo info)
Generate defaults when certain parameters are not specified.
|
Node |
Node.setJSDocInfo(JSDocInfo info)
Sets the
JSDocInfo attached to this node. |
Constructor and Description |
---|
JSDocInfoBuilder(JSDocInfo info,
boolean parseDocumentation,
boolean populated) |
Modifier and Type | Field and Description |
---|---|
private JSDocInfo |
ObjectType.docInfo |
private JSDocInfo |
Property.docInfo
The JSDocInfo for this property.
|
Modifier and Type | Method and Description |
---|---|
JSDocInfo |
JSType.getJSDocInfo()
Gets the docInfo for this type.
|
JSDocInfo |
ObjectType.getJSDocInfo()
Gets the docInfo for this type.
|
JSDocInfo |
Property.getJSDocInfo() |
JSDocInfo |
ProxyObjectType.getJSDocInfo() |
JSDocInfo |
SimpleSlot.getJSDocInfo() |
JSDocInfo |
ObjectType.getOwnPropertyJSDocInfo(java.lang.String propertyName)
Gets the docInfo on the specified property on this type.
|
Modifier and Type | Method and Description |
---|---|
ObjectType |
JSTypeRegistry.createAnonymousObjectType(JSDocInfo info)
Create an anonymous object type.
|
boolean |
JSTypeRegistry.isTemplatedBuiltin(java.lang.String fnName,
JSDocInfo info)
Check if a function declaration is one of the templated builitin contructor/interfaces,
namely one of IObject, IArrayLike, or Array
|
void |
ObjectType.setJSDocInfo(JSDocInfo info)
Sets the docInfo for this type from the given
JSDocInfo . |
(package private) void |
Property.setJSDocInfo(JSDocInfo info) |
void |
ProxyObjectType.setJSDocInfo(JSDocInfo info) |
void |
NoObjectType.setPropertyJSDocInfo(java.lang.String propertyName,
JSDocInfo info) |
void |
ObjectType.setPropertyJSDocInfo(java.lang.String propertyName,
JSDocInfo info)
Sets the docInfo for the specified property from the
JSDocInfo on its definition. |
void |
PrototypeObjectType.setPropertyJSDocInfo(java.lang.String propertyName,
JSDocInfo info) |
void |
ProxyObjectType.setPropertyJSDocInfo(java.lang.String propertyName,
JSDocInfo info) |