com.google.javascript.jscomp.VariableReferenceCheck.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?
java/lang/Object ()V java/util/LinkedHashSet
3com/google/javascript/jscomp/VariableReferenceCheck blocksWithDeclarations Ljava/util/Set; compiler /Lcom/google/javascript/jscomp/AbstractCompiler;
-com/google/javascript/jscomp/AbstractCompiler
getOptions 0()Lcom/google/javascript/jscomp/CompilerOptions; UNUSED_LOCAL_ASSIGNMENT -Lcom/google/javascript/jscomp/DiagnosticType;
! " # ,com/google/javascript/jscomp/DiagnosticGroup forType ](Lcom/google/javascript/jscomp/DiagnosticType;)Lcom/google/javascript/jscomp/DiagnosticGroup;
% & ' ( ) ,com/google/javascript/jscomp/CompilerOptions enables 1(Lcom/google/javascript/jscomp/DiagnosticGroup;)Z + , - checkUnusedLocals Z / /com/google/javascript/jscomp/ReferenceCollector 1 Mcom/google/javascript/jscomp/VariableReferenceCheck$ReferenceCheckingBehavior
0 3 4 8(Lcom/google/javascript/jscomp/VariableReferenceCheck;)V 6 2com/google/javascript/jscomp/SyntacticScopeCreator
5 8 9 2(Lcom/google/javascript/jscomp/AbstractCompiler;)V
. ; < ?(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/jscomp/ReferenceCollector$Behavior;Lcom/google/javascript/jscomp/ScopeCreator;)V
. > ? @ process G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V B C D E F java/util/List iterator ()Ljava/util/Iterator; H I J K L java/util/Iterator hasNext ()Z H N O P next ()Ljava/lang/Object; R &com/google/javascript/jscomp/Reference
Q T U L isHoistedFunction
Q W X Y
getBasicBlock +()Lcom/google/javascript/jscomp/BasicBlock; [ \ ] ^ _
java/util/Set add (Ljava/lang/Object;)Z
Q a b L isVarDeclaration
Q d e f getGrandparent $()Lcom/google/javascript/rhino/Node;
h i j k L com/google/javascript/rhino/Node isAddedBlock m n o *BLOCKLESS_DECLARATION_FORBIDDEN_STATEMENTS (Lcom/google/common/collect/ImmutableSet;
h q r f getParent
h t u v getToken %()Lcom/google/javascript/rhino/Token;
x y z { _ &com/google/common/collect/ImmutableSet contains } ~ !DECLARATION_NOT_DIRECTLY_IN_BLOCK ? java/lang/String
? ? ? ? ? com/google/javascript/jscomp/Var getName ()Ljava/lang/String;
? ? ? ? ? $com/google/javascript/jscomp/JSError make ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)Lcom/google/javascript/jscomp/JSError;
? ? ? report )(Lcom/google/javascript/jscomp/JSError;)V
? ? ? f
getParentNode
h ? ? L isVar
Q ? ? L isLetDeclaration
Q ? ? L isConstDeclaration
? ? ? f getNode
Q ?
h ? ? L isCatch
? ? ? isRedeclaration ,(Lcom/google/javascript/jscomp/BasicBlock;)Z
? ? ? f getNameNode
? ? ? ? ? %com/google/javascript/jscomp/VarCheck "hasDuplicateDeclarationSuppression v(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Z
? ? ? L isParam
? ? ? ? ? %com/google/javascript/jscomp/NodeUtil isBlockScopedDeclaration %(Lcom/google/javascript/rhino/Node;)Z
? ? ? ? getScope .()Lcom/google/javascript/jscomp/AbstractScope;
Q ? ? ? &()Lcom/google/javascript/jscomp/Scope;
? ? ? r ? "com/google/javascript/jscomp/Scope
h ? ? L
isFunction
h ? ? f
getFirstChild
? ? ? L isLet
? ? ? L isConst
? ? ? L isClass
? ? ? L isImport ? ? REDECLARED_VARIABLE_ERROR
? ? ? L isGlobal ? ? ? VAR_MULTIPLY_DECLARED_ERROR ? ? REDECLARED_VARIABLE
h ? ? ? getString
? ? _ equals
? ? ?
locationOf 6(Lcom/google/javascript/rhino/Node;)Ljava/lang/String; [ C ? 'com/google/javascript/jscomp/BasicBlock
? ? ? ? provablyExecutesBefore ?
h ? ? ? getLocation
h ? ? L
isFromExterns
? ? ? L isImplicitGoogNamespace
? ?
Q q
h L isOr
h L isName
? f getRootNode
h
L isMemberFieldDef
h
L isStaticMember
? hasSameContainerScope /(Lcom/google/javascript/jscomp/AbstractScope;)Z goog
? L isGoogModuleExports EARLY_EXPORTS_REFERENCE EARLY_REFERENCE_ERROR EARLY_REFERENCE
?"# L isLocal
?%&' getBestJSDocInfo K(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/JSDocInfo;
)*+, L %com/google/javascript/rhino/JSDocInfo hasTypedefType
?./ L isFunctionBlockScope
h12 f getPrevious 456
GOOG_SCOPE +Lcom/google/javascript/rhino/QualifiedName;
89:; ? )com/google/javascript/rhino/QualifiedName matches
?=> L
isModuleScope
?@AB getEnclosingStatement F(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
?DE ? isNameDeclaration GH6 GOOG_FORWARD_DECLARE
?JKL isCallTo P(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/QualifiedName;)Z NO6 GOOG_REQUIRE_TYPE QR6 GOOG_REQUIRE
hTU L isQualifiedNameW JSC_REFERENCE_BEFORE_DECLAREY +Variable referenced before declaration: {0}
[\]^_ +com/google/javascript/jscomp/DiagnosticType warning S(Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/jscomp/DiagnosticType;a #JSC_EXPORTS_REFERENCE_BEFORE_ASSIGNc @Illegal reference to `exports` before assignment `exports = ...`
[ef_ errorh JSC_REDECLARED_VARIABLEj Redeclared variable: {0}l "JSC_REFERENCE_BEFORE_DECLARE_ERRORn 2Illegal variable reference before declaration: {0}p JSC_REASSIGNED_CONSTANTr Constant reassigned: {0} tu REASSIGNED_CONSTANTw JSC_REDECLARED_VARIABLE_ERRORy Illegal redeclared variable: {0}{ %JSC_DECLARATION_NOT_DIRECTLY_IN_BLOCK} 7Block-scoped declaration not directly within block: {0} JSC_UNUSED_LOCAL_ASSIGNMENT? 2Value assigned to local variable {0} is never read
[??_ disabled? goog.require
8??? of ?(Ljava/lang/String;)Lcom/google/javascript/rhino/QualifiedName;? goog.requireType? goog.forwardDeclare ????? !com/google/javascript/rhino/Token IF #Lcom/google/javascript/rhino/Token; ???? FOR ???? FOR_IN ???? FOR_OF ???? FOR_AWAIT_OF ???? WHILE
????? com/google/common/collect/Sets immutableEnumSet K(Ljava/lang/Enum;[Ljava/lang/Enum;)Lcom/google/common/collect/ImmutableSet;?
goog.scope? )com/google/javascript/jscomp/CompilerPass Signature :Ljava/util/Set; MLcom/google/common/collect/ImmutableSet; Code LineNumberTable LocalVariableTable this 5Lcom/google/javascript/jscomp/VariableReferenceCheck; MethodParameters externs "Lcom/google/javascript/rhino/Node; root lookForHoistedFunction :(Ljava/util/List;)Lcom/google/javascript/jscomp/Reference; reference (Lcom/google/javascript/jscomp/Reference;
references Ljava/util/List; LocalVariableTypeTable :Ljava/util/List;
StackMapTable d(Ljava/util/List;)Lcom/google/javascript/jscomp/Reference; RuntimeVisibleTypeAnnotations #Lorg/jspecify/annotations/Nullable; checkBlocklessDeclaration o(Lcom/google/javascript/jscomp/Var;Lcom/google/javascript/jscomp/Reference;Lcom/google/javascript/rhino/Node;)V v "Lcom/google/javascript/jscomp/Var;
referenceNode checkRedeclaration ?(Lcom/google/javascript/jscomp/Var;Lcom/google/javascript/jscomp/Reference;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/Reference;Lcom/google/javascript/jscomp/BasicBlock;)Z diagnosticType warningNode shadowParam isFunctionDecl hoistedFn
basicBlock )Lcom/google/javascript/jscomp/BasicBlock; letConstShadowsVar isVarNodeSameAsReferenceNode shadowCatchVar previousDeclaration newDeclaration n checkEarlyReference o(Lcom/google/javascript/jscomp/Var;Lcom/google/javascript/jscomp/Reference;Lcom/google/javascript/rhino/Node;)Z curr referenceScopeRoot checkForUnusedLocalVar M(Lcom/google/javascript/jscomp/Var;Lcom/google/javascript/jscomp/Reference;)V function callee lhs rhs statement unusedAssignment jsDoc 'Lcom/google/javascript/rhino/JSDocInfo; inGoogScope s $Lcom/google/javascript/jscomp/Scope;
SourceFile VariableReferenceCheck.java NestMembers? Ocom/google/javascript/jscomp/VariableReferenceCheck$ReferenceCheckingBehavior$1 InnerClasses ReferenceCheckingBehavior? 8com/google/javascript/jscomp/ReferenceCollector$Behavior Behavior ? ? u ? ~ R6 O6 H6 , - ? ? n o ? ? 56
9 ? n &*? *? Y? ?
*+? *+? ? ? ? $? *? ? ] R ^ _ ` % a? &?? &