Package com.google.javascript.jscomp
Class ConformanceRules.BanNonLiteralArgsToGoogStringConstFrom
java.lang.Object
com.google.javascript.jscomp.ConformanceRules.AbstractRule
com.google.javascript.jscomp.ConformanceRules.BanNonLiteralArgsToGoogStringConstFrom
- All Implemented Interfaces:
CheckConformance.Rule
- Enclosing class:
ConformanceRules
public static final class ConformanceRules.BanNonLiteralArgsToGoogStringConstFrom
extends ConformanceRules.AbstractRule
Banned non-literal arguments passed to
goog.string.Const.from
. Possible calls to
goog.string.Const in user code could look like:
`goog.string.Const.from('foo');` `const alias = goog.string.Const.from; alias(foo);` `const {from} = goog.require('goog.string.Const'); from(foo);` `const alias = goog.require('goog.string.Const'); alias.from(foo);`
-
Constructor Summary
ConstructorsConstructorDescriptionBanNonLiteralArgsToGoogStringConstFrom
(AbstractCompiler compiler, com.google.javascript.jscomp.Requirement requirement) -
Method Summary
Modifier and TypeMethodDescriptionprotected ConformanceRules.ConformanceResult
checkConformance
(NodeTraversal t, Node node) Methods inherited from class com.google.javascript.jscomp.ConformanceRules.AbstractRule
check, report, tsIsAllowlisted
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.CheckConformance.Rule
getPrecondition
-
Constructor Details
-
BanNonLiteralArgsToGoogStringConstFrom
public BanNonLiteralArgsToGoogStringConstFrom(AbstractCompiler compiler, com.google.javascript.jscomp.Requirement requirement) throws CheckConformance.InvalidRequirementSpec
-
-
Method Details
-
checkConformance
- Specified by:
checkConformance
in classConformanceRules.AbstractRule
- Returns:
- Whether the code represented by the Node conforms to the rule.
-