Package com.google.javascript.jscomp
Class ChromeCodingConvention
- java.lang.Object
-
- com.google.javascript.jscomp.CodingConventions.Proxy
-
- com.google.javascript.jscomp.ChromeCodingConvention
-
- All Implemented Interfaces:
CodingConvention
,java.io.Serializable
@Immutable public final class ChromeCodingConvention extends CodingConventions.Proxy
Coding convention used by the Chrome team to compile Chrome's JS.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.javascript.jscomp.CodingConvention
CodingConvention.AssertionFunctionLookup, CodingConvention.AssertionFunctionSpec, CodingConvention.Bind, CodingConvention.Cache, CodingConvention.DelegateRelationship, CodingConvention.ObjectLiteralCast, CodingConvention.SubclassRelationship, CodingConvention.SubclassType
-
-
Field Summary
-
Fields inherited from class com.google.javascript.jscomp.CodingConventions.Proxy
nextConvention
-
-
Constructor Summary
Constructors Constructor Description ChromeCodingConvention()
ChromeCodingConvention(CodingConvention wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applySingletonGetter(NominalTypeBuilder classType, FunctionType getterType)
In many JS libraries, the function that adds a singleton getter to a class adds properties to the class.com.google.common.collect.ImmutableCollection<java.lang.String>
getIndirectlyDeclaredProperties()
Gets a collection of all properties that are defined indirectly on global objects.java.lang.String
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.-
Methods inherited from class com.google.javascript.jscomp.CodingConventions.Proxy
applyDelegateRelationship, applySubclassRelationship, blockRenamingForProperty, checkForCallingConventionDefinitions, defineDelegateProxyPrototypeProperties, describeCachingCall, describeFunctionBind, describeFunctionBind, extractClassNameIfProvide, extractClassNameIfRequire, extractIsModuleFile, getAbstractMethodName, getAssertionFunctions, getClassesDefinedByCall, getDelegateRelationship, getDelegateSuperclassName, getExportPropertyFunction, getExportSymbolFunction, getGlobalObject, getObjectLiteralCast, getPackageName, hasPrivacyConvention, identifyTypeDeclarationCall, isClassFactoryCall, isConstant, isConstantKey, isExported, isExported, isFunctionCallThatAlwaysThrows, isInlinableFunction, isOptionalParameter, isPrivate, isPropertyRenameFunction, isPropertyTestFunction, isPrototypeAlias, isSuperClassReference, isValidEnumKey, isVarArgsParameter
-
-
-
-
Constructor Detail
-
ChromeCodingConvention
public ChromeCodingConvention()
-
ChromeCodingConvention
public ChromeCodingConvention(CodingConvention wrapped)
-
-
Method Detail
-
getSingletonGetterClassName
public java.lang.String getSingletonGetterClassName(Node callNode)
Description copied from interface:CodingConvention
Checks if the given method defines a singleton getter, and if it does, returns the name of the class with the singleton getter. By default, always returns null. Meant to be overridden by subclasses. addSingletonGetter needs a coding convention because in the general case, it can't be inlined. The function inliner sees that it creates an alias to the given class in an inner closure, and bails out.- Specified by:
getSingletonGetterClassName
in interfaceCodingConvention
- Overrides:
getSingletonGetterClassName
in classCodingConventions.Proxy
- Parameters:
callNode
- A CALL node.
-
applySingletonGetter
public void applySingletonGetter(NominalTypeBuilder classType, FunctionType getterType)
Description copied from interface:CodingConvention
In many JS libraries, the function that adds a singleton getter to a class adds properties to the class.- Specified by:
applySingletonGetter
in interfaceCodingConvention
- Overrides:
applySingletonGetter
in classCodingConventions.Proxy
-
getIndirectlyDeclaredProperties
public com.google.common.collect.ImmutableCollection<java.lang.String> getIndirectlyDeclaredProperties()
Description copied from interface:CodingConvention
Gets a collection of all properties that are defined indirectly on global objects. (For example, Closure defines superClass_ in the goog.inherits call).- Specified by:
getIndirectlyDeclaredProperties
in interfaceCodingConvention
- Overrides:
getIndirectlyDeclaredProperties
in classCodingConventions.Proxy
-
-