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.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 TypeMethodDescriptionvoidapplySingletonGetter(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
applySubclassRelationship, describeCachingCall, describeFunctionBind, describeFunctionBind, extractClassNameIfProvide, extractClassNameIfRequire, extractIsModuleFile, getAbstractMethodName, getAssertionFunctions, getClassesDefinedByCall, getExportPropertyFunction, getExportSymbolFunction, getObjectLiteralCast, getPackageName, identifyTypeDeclarationCall, isClassFactoryCall, isConstant, isConstantKey, isExported, isExported, isFunctionCallThatAlwaysThrows, isOptionalParameter, isPropertyRenameFunction, isPropertyTestFunction, isPrototypeAlias, isSuperClassReference, isValidEnumKey, isVarArgsParameterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.javascript.jscomp.CodingConvention
blockRenamingForProperty
-
Constructor Details
-
ChromeCodingConvention
public ChromeCodingConvention() -
ChromeCodingConvention
-
-
Method Details
-
getSingletonGetterClassName
Description copied from interface:CodingConventionChecks 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:
getSingletonGetterClassNamein interfaceCodingConvention- Overrides:
getSingletonGetterClassNamein classCodingConventions.Proxy- Parameters:
callNode- A CALL node.
-
applySingletonGetter
Description copied from interface:CodingConventionIn many JS libraries, the function that adds a singleton getter to a class adds properties to the class.- Specified by:
applySingletonGetterin interfaceCodingConvention- Overrides:
applySingletonGetterin classCodingConventions.Proxy
-
getIndirectlyDeclaredProperties
Description copied from interface:CodingConventionGets a collection of all properties that are defined indirectly on global objects. (For example, Closure defines superClass_ in the goog.inherits call).- Specified by:
getIndirectlyDeclaredPropertiesin interfaceCodingConvention- Overrides:
getIndirectlyDeclaredPropertiesin classCodingConventions.Proxy
-