com.google.javascript.jscomp.lint.CheckNullabilityModifiers.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of closure-compiler-unshaded Show documentation
Show all versions of closure-compiler-unshaded Show documentation
Closure Compiler is a JavaScript optimizing compiler. It parses your
JavaScript, analyzes it, removes dead code and rewrites and minimizes
what's left. It also checks syntax, variable references, and types, and
warns about common JavaScript pitfalls. It is used in many of Google's
JavaScript apps, including Gmail, Google Web Search, Google Maps, and
Google Docs.
The newest version!
???? 7?
Dcom/google/javascript/jscomp/NodeTraversal$AbstractPostOrderCallback ()V java/util/LinkedHashSet
;com/google/javascript/jscomp/lint/CheckNullabilityModifiers redundantCandidates Ljava/util/LinkedHashSet; missingCandidates nullMissingCandidates templateTypeNames compiler /Lcom/google/javascript/jscomp/AbstractCompiler;
! " *com/google/javascript/jscomp/NodeTraversal
traverseRoots ?(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/jscomp/NodeTraversal$Callback;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V
$ % & ' ( com/google/javascript/rhino/Node getJSDocInfo )()Lcom/google/javascript/rhino/JSDocInfo;
* + , - . %com/google/javascript/rhino/JSDocInfo getTemplateTypeNames +()Lcom/google/common/collect/ImmutableList;
0 1 2 addAll (Ljava/util/Collection;)Z
* 4 5 6 getTypeTransformations *()Lcom/google/common/collect/ImmutableMap;
8 9 : ; < &com/google/common/collect/ImmutableMap keySet *()Lcom/google/common/collect/ImmutableSet;
* > ? @ hasType ()Z
* B C D getType 0()Lcom/google/javascript/rhino/JSTypeExpression;
F G H
handleHasType S(Lcom/google/javascript/rhino/JSTypeExpression;Lcom/google/javascript/rhino/Node;)V
* J K L getParameterNames ()Ljava/util/Set; N O P Q R
java/util/Set iterator ()Ljava/util/Iterator; T U V W @ java/util/Iterator hasNext T Y Z [ next ()Ljava/lang/Object; ] java/lang/String
* _ ` a hasParameterType (Ljava/lang/String;)Z
* c d e getParameterType B(Ljava/lang/String;)Lcom/google/javascript/rhino/JSTypeExpression;
g h i visitTypeExpression 2(Lcom/google/javascript/rhino/JSTypeExpression;Z)V
* k l @
hasReturnType
* n o D
getReturnType
* q r @ hasEnumParameterType
* t u D getEnumParameterType
* w x @ hasTypedefType
* z { D getTypedefType
* } ~ @ hasThisType
* ? ? D getThisType
$ ? ? @ isScript
? ? ? report /(Lcom/google/javascript/jscomp/NodeTraversal;)V
? ? clear
$ ? ? ?
getFirstChild $()Lcom/google/javascript/rhino/Node;
? ? ? ? ? %com/google/javascript/jscomp/NodeUtil isNameDeclOrSimpleAssignLhs G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Z
? ? ? ? getRValueOfLValue F(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
$ ? ? @ isNull
? h ? T(Lcom/google/javascript/rhino/JSTypeExpression;ZLcom/google/javascript/rhino/Node;)V
O
? ? ? shouldReport %(Lcom/google/javascript/rhino/Node;)Z ? ? ? "MISSING_NULLABILITY_MODIFIER_JSDOC -Lcom/google/javascript/jscomp/DiagnosticType;
? ? ? getReportedTypeName 6(Lcom/google/javascript/rhino/Node;)Ljava/lang/String;
? ? ? e(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)V ? ? ? 'NULL_MISSING_NULLABILITY_MODIFIER_JSDOC
$ ? ? ? getParent ? ? ? $REDUNDANT_NULLABILITY_MODIFIER_JSDOC
$ ? ? @ isStringLit
$ ? ? ? getString ()Ljava/lang/String;
? ? ? contains (Ljava/lang/Object;)Z
? ? ? ? ? ,com/google/javascript/rhino/JSTypeExpression getRoot ? ? ? visit ?(Lcom/google/javascript/jscomp/lint/CheckNullabilityModifiers;ZLcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/jscomp/NodeUtil$Visitor;
? ? ? ?
visitPreOrder T(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/NodeUtil$Visitor;)V ? ? ? PRIMITIVE_TYPE_NAMES (Lcom/google/common/collect/ImmutableSet;
? ? ? &com/google/common/collect/ImmutableSet
$ ? ? @
isFunction
$ ? ? ? getToken %()Lcom/google/javascript/rhino/Token; ? ? ? ? ? !com/google/javascript/rhino/Token LC #Lcom/google/javascript/rhino/Token;
? ? ? isFunctionLiteral ? Function
? ? ? isRecordLiteral ? Record literal
? ? ? isPrimitiveType
? ? ? isReferenceType
? ? ? ? ? $com/google/common/base/Preconditions
checkState (Z)V ? ? ? ? BANG ? ? ? QMARK
$ @ isNew
$ @ isThis
$ @ isTypeOf ? ? PIPE
? add &JSC_MISSING_NULLABILITY_MODIFIER_JSDOC ?{0} is a reference type with no nullability modifier, which is disallowed by the style guide.
Please add a '!' to make it explicitly non-nullable, or a '?' to make it explicitly nullable.
+com/google/javascript/jscomp/DiagnosticType disabled S(Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/jscomp/DiagnosticType; +JSC_NULL_MISSING_NULLABILITY_MODIFIER_JSDOC ~{0} is a reference type with no nullability modifier that is explicitly set to null.
Add a '?' to make it explicitly nullable. (JSC_REDUNDANT_NULLABILITY_MODIFIER_JSDOC! ?{0} is a non-reference type which is already non-nullable.
Please remove the redundant '!', which is disallowed by the style guide.# boolean% number' bigint) string+ symbol- undefined/ void1 null
?345 of ?(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Lcom/google/common/collect/ImmutableSet;7 )com/google/javascript/jscomp/CompilerPass Signature ; =Ljava/util/LinkedHashSet; -Ljava/util/LinkedHashSet; 2(Lcom/google/javascript/jscomp/AbstractCompiler;)V Code LineNumberTable LocalVariableTable this =Lcom/google/javascript/jscomp/lint/CheckNullabilityModifiers; MethodParameters process G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V externs "Lcom/google/javascript/rhino/Node; root s(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V param Ljava/lang/String; t ,Lcom/google/javascript/jscomp/NodeTraversal; n parent info 'Lcom/google/javascript/rhino/JSDocInfo;
StackMapTable rValue expr .Lcom/google/javascript/rhino/JSTypeExpression; hasArtificialTopLevelBang Z RuntimeVisibleTypeAnnotations #Lorg/jspecify/annotations/Nullable; node lambda$visitTypeExpression$0 j(ZLcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V isPrimitiveOrLiteral isReference hasBang hasQmark hasNonArtificialBang isNewOrThis isTypeOfType isAppliedToRValue
SourceFile CheckNullabilityModifiers.java BootstrapMethodsi
jklmn "java/lang/invoke/LambdaMetafactory metafactory ?(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;p %(Lcom/google/javascript/rhino/Node;)Vr
sZ[ InnerClasses AbstractPostOrderCallbackw 3com/google/javascript/jscomp/NodeTraversal$Callback Callbackz -com/google/javascript/jscomp/NodeUtil$Visitor Visitor} %java/lang/invoke/MethodHandles$Lookup java/lang/invoke/MethodHandles Lookup ! 6 ? ? ? ? ? ? ? ? 8 9 8 : 8 : 8 : 8 ; <