com.google.javascript.jscomp.MakeDeclaredNamesUnique$ContextualRenameInverter.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/ArrayDeque
Mcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter scopeContextStack Ljava/util/Deque; bcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$VariableInfoStackMap
R(Lcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter;)V variablesStackedByName dLcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$VariableInfoStackMap; compiler /Lcom/google/javascript/jscomp/AbstractCompiler;
! " *com/google/javascript/jscomp/NodeTraversal traverse ?(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/NodeTraversal$Callback;)V
$ % & indexOfSeparator (Ljava/lang/String;)I
( ) * + , java/lang/String substring (II)Ljava/lang/String; . Fcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenamer 0 $jscomp$
( 2 3 & lastIndexOf
5 6 7
inGlobalScope ()Z
9 : ; getScope &()Lcom/google/javascript/jscomp/Scope;
= > ? @ A 'com/google/common/collect/ImmutableList builder 3()Lcom/google/common/collect/ImmutableList$Builder;
C D E F G "com/google/javascript/jscomp/Scope getVarIterable ()Ljava/lang/Iterable; I J K L M java/lang/Iterable iterator ()Ljava/util/Iterator; O P Q R 7 java/util/Iterator hasNext O T U V next ()Ljava/lang/Object; X com/google/javascript/jscomp/Var
Z [ \ createDeclaredVariableInfo ?(Lcom/google/javascript/jscomp/Var;)Lcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$DeclaredVariableInfo;
^ _ ` a b /com/google/common/collect/ImmutableList$Builder add E(Ljava/lang/Object;)Lcom/google/common/collect/ImmutableList$Builder;
d e f pushVariableInfo _(Lcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$VariableInfo;)V h i j k V java/util/Deque peek m Zcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$ScopeContext
^ o p q build +()Lcom/google/common/collect/ImmutableList;
l s t ?(Lcom/google/javascript/jscomp/Scope;Lcom/google/common/collect/ImmutableList;Lcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$ScopeContext;)V h v w x push (Ljava/lang/Object;)V
W z { | getName ()Ljava/lang/String; ~ Zcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$RenamingInfo
} ? ? v(Lcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter;Ljava/lang/String;Ljava/lang/String;)V ? bcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$DeclaredVariableInfo
? ? ? ?(Lcom/google/javascript/jscomp/Var;Lcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$RenamingInfo;)V h ? ? V pop
? ? ? ? ? $com/google/common/base/Preconditions checkNotNull &(Ljava/lang/Object;)Ljava/lang/Object; l ? ? ? referencedVariables Ljava/util/Set; ? J ?
java/util/Set ? Zcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$VariableInfo
l ? ? f recordPotentialConflicts l ? ? ? declaredVariableInfos )Lcom/google/common/collect/ImmutableList;
= ? L ? 2()Lcom/google/common/collect/UnmodifiableIterator;
? z
? ? ? popVariableInfo p(Ljava/lang/String;)Lcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$VariableInfo; ? 8Declared variable "%s" was not the top of the name stack
? ? ? ?
checkState ((ZLjava/lang/String;Ljava/lang/Object;)V
? ? ? tryToInvertName h ? ? 7 isEmpty
? ? clear
? ? ? ? ? %com/google/javascript/jscomp/NodeUtil isReferenceName %(Lcom/google/javascript/rhino/Node;)Z
? ? ? ? 7 com/google/javascript/rhino/Node isImportStar
? ? ? | getString
? ? ? getOrCreateCurrentVariableInfo ? ? ? ? addReferenceNode %(Lcom/google/javascript/rhino/Node;)V
l ? ? f addReferencedVariableInfo ? dcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$UndeclaredVariableInfo
? ? ? (Ljava/lang/String;)V ? 9com/google/javascript/jscomp/NodeTraversal$ScopedCallback ? )com/google/javascript/jscomp/CompilerPass Signature oLjava/util/Deque; 2(Lcom/google/javascript/jscomp/AbstractCompiler;)V Code LineNumberTable LocalVariableTable this OLcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter; MethodParameters process G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V externs "Lcom/google/javascript/rhino/Node; js getOriginalName &(Ljava/lang/String;)Ljava/lang/String; name Ljava/lang/String; index I
StackMapTable
enterScope /(Lcom/google/javascript/jscomp/NodeTraversal;)V variableInfo dLcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$DeclaredVariableInfo; var "Lcom/google/javascript/jscomp/Var; t ,Lcom/google/javascript/jscomp/NodeTraversal; scope $Lcom/google/javascript/jscomp/Scope; declaredVariablesBuilder 1Lcom/google/common/collect/ImmutableList$Builder; parent \Lcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$ScopeContext; LocalVariableTypeTable ?Lcom/google/common/collect/ImmutableList$Builder; invertedName renamingInfo \Lcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$RenamingInfo; currentName exitScope referencedVariable \Lcom/google/javascript/jscomp/MakeDeclaredNamesUnique$ContextualRenameInverter$VariableInfo; variableName oldStackTop declaredVariableInfo scopeContext shouldTraverse s(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Z n visit s(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V node createUndeclaredVariableInfo
SourceFile MakeDeclaredNamesUnique.java NestHost 4com/google/javascript/jscomp/MakeDeclaredNamesUnique InnerClasses ContextualRenameInverter VariableInfoStackMap 3com/google/javascript/jscomp/NodeTraversal$Callback Callback ContextualRenamer Builder DeclaredVariableInfo VariableInfo ScopeContext RenamingInfo UndeclaredVariableInfo ScopedCallback ? ? ? ?
? ? e !*? *? Y? ?
*? Y*? ? *+? ? ? ?
? ! ? ? ! ? ? ? ? L
*? ,*? ? ?
?
? ?
? ?
? ? ? ? ? ? ? ? \ *? #<? *? *? '? ?
? ? ? ? ? ?
?
E ( ? ?
% &