Package com.google.javascript.jscomp
Class CodingConvention.AssertionFunctionSpec
java.lang.Object
com.google.javascript.jscomp.CodingConvention.AssertionFunctionSpec
- Direct Known Subclasses:
ClosureCodingConvention.AssertInstanceofSpec
- Enclosing interface:
- CodingConvention
A function that will throw an exception when either:
-One or more of its parameters evaluate to false.
-One or more of its parameters are not of a certain type.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAssertionFunctionSpec
(String functionName) AssertionFunctionSpec
(String functionName, JSTypeNative assertedType) -
Method Summary
Modifier and TypeMethodDescriptiongetAssertedParam
(Node firstParam) Returns the parameter of the assertion function that is being checked.getAssertedType
(Node call, JSTypeRegistry registry) Returns the type for a type assertion, or null if the function asserts that the node must not be null or undefined.Returns the name of the function.
-
Field Details
-
functionName
-
assertedType
-
-
Constructor Details
-
AssertionFunctionSpec
-
AssertionFunctionSpec
-
-
Method Details
-
getFunctionName
Returns the name of the function. -
getAssertedParam
Returns the parameter of the assertion function that is being checked.- Parameters:
firstParam
- The first parameter of the function call.
-
getAssertedType
Returns the type for a type assertion, or null if the function asserts that the node must not be null or undefined.- Parameters:
call
- The asserting call
-