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.ConformanceResult
checkConformance(NodeTraversal t, Node n)
protected boolean
isAllowlistedType(Node n)
protected boolean
isAssertionCall(Node n)
protected static boolean
isKnown(Node n)
protected boolean
isNativeObjectType(Node n)
protected static boolean
isTemplateType(Node n)
protected static boolean
isTop(Node n)
protected boolean
isTypeImmediatelyTightened(Node n)
protected static boolean
isUnknown(Node n)
protected boolean
isUsed(Node n)
protected JSType
union(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:
checkConformance
in 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)
-
-