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
,Serializable
Coding convention used by the Chrome team to compile Chrome's JS.
- See Also:
-
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
<String> Gets a collection of all properties that are defined indirectly on global objects.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, checkForCallingConventionDefinitions, defineDelegateProxyPrototypeProperties, describeCachingCall, describeFunctionBind, describeFunctionBind, extractClassNameIfProvide, extractClassNameIfRequire, extractIsModuleFile, getAbstractMethodName, getAssertionFunctions, getClassesDefinedByCall, getDelegateRelationship, getDelegateSuperclassName, getExportPropertyFunction, getExportSymbolFunction, getObjectLiteralCast, getPackageName, identifyTypeDeclarationCall, isClassFactoryCall, isConstant, isConstantKey, isExported, isExported, isFunctionCallThatAlwaysThrows, isOptionalParameter, isPropertyRenameFunction, isPropertyTestFunction, isPrototypeAlias, isSuperClassReference, isValidEnumKey, isVarArgsParameter
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.javascript.jscomp.CodingConvention
blockRenamingForProperty
-
Constructor Details
-
ChromeCodingConvention
public ChromeCodingConvention() -
ChromeCodingConvention
-
-
Method Details
-
getSingletonGetterClassName
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
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
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
-