Package com.google.javascript.jscomp
Class ConformanceRules.BanUnknownDirectThisPropsReferences
- java.lang.Object
-
- com.google.javascript.jscomp.ConformanceRules.AbstractRule
-
- com.google.javascript.jscomp.ConformanceRules.BanUnknownDirectThisPropsReferences
-
- All Implemented Interfaces:
CheckConformance.Rule
- Enclosing class:
- ConformanceRules
public static final class ConformanceRules.BanUnknownDirectThisPropsReferences extends ConformanceRules.AbstractRule
Banned unknown type references of the form "this.prop" unless - it is immediately cast, - it is a @template type (until template type restricts are enabled) or - the value is unused. - the "this" type is unknown (as this is expected to be used with BanUnknownThis which would have already reported the root cause).
-
-
Constructor Summary
Constructors Constructor Description BanUnknownDirectThisPropsReferences(AbstractCompiler compiler, Requirement requirement)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConformanceRules.ConformanceResultcheckConformance(NodeTraversal t, Node n)protected booleanisAllowlistedType(Node n)protected booleanisAssertionCall(Node n)protected static booleanisKnown(Node n)protected booleanisNativeObjectType(Node n)protected static booleanisTemplateType(Node n)protected static booleanisTop(Node n)protected booleanisTypeImmediatelyTightened(Node n)protected static booleanisUnknown(Node n)protected booleanisUsed(Node n)protected JSTypeunion(java.util.List<java.lang.String> typeNames)-
Methods inherited from class com.google.javascript.jscomp.ConformanceRules.AbstractRule
check, report, tsIsAllowlisted
-
-
-
-
Constructor Detail
-
BanUnknownDirectThisPropsReferences
public BanUnknownDirectThisPropsReferences(AbstractCompiler compiler, Requirement requirement) throws CheckConformance.InvalidRequirementSpec
-
-
Method Detail
-
checkConformance
protected ConformanceRules.ConformanceResult checkConformance(NodeTraversal t, Node n)
- Specified by:
checkConformancein classConformanceRules.AbstractRule- Returns:
- Whether the code represented by the Node conforms to the rule.
-
isAllowlistedType
protected boolean isAllowlistedType(Node n)
-
isKnown
protected static boolean isKnown(Node n)
-
isNativeObjectType
protected boolean isNativeObjectType(Node n)
-
isTop
protected static boolean isTop(Node n)
-
isUnknown
protected static boolean isUnknown(Node n)
-
isTemplateType
protected static boolean isTemplateType(Node n)
-
union
protected JSType union(java.util.List<java.lang.String> typeNames)
-
isAssertionCall
protected boolean isAssertionCall(Node n)
-
isTypeImmediatelyTightened
protected boolean isTypeImmediatelyTightened(Node n)
-
isUsed
protected boolean isUsed(Node n)
-
-