com.google.javascript.jscomp.NodeTraversal.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? 2com/google/javascript/jscomp/NodeTraversal$Builder
()V
java/lang/Object java/util/ArrayList
*com/google/javascript/jscomp/NodeTraversal scopes Ljava/util/ArrayList; compiler /Lcom/google/javascript/jscomp/AbstractCompiler;
$com/google/common/base/Preconditions checkNotNull &(Ljava/lang/Object;)Ljava/lang/Object; -com/google/javascript/jscomp/AbstractCompiler ! " # callback 5Lcom/google/javascript/jscomp/NodeTraversal$Callback; % 3com/google/javascript/jscomp/NodeTraversal$Callback ! ( 9com/google/javascript/jscomp/NodeTraversal$ScopedCallback * + ,
scopeCallback ;Lcom/google/javascript/jscomp/NodeTraversal$ScopedCallback; . / 0 scopeCreator +Lcom/google/javascript/jscomp/ScopeCreator; 2 2com/google/javascript/jscomp/SyntacticScopeCreator
1 4 5 2(Lcom/google/javascript/jscomp/AbstractCompiler;)V . 8 9 : .obeyDestructuringAndDefaultValueExecutionOrder Z 8
= > ? @ A java/lang/Throwable
getMessage ()Ljava/lang/String; C D E
currentScript "Lcom/google/javascript/rhino/Node; G Node I J E currentNode
L M N formatNodeContext H(Ljava/lang/String;Lcom/google/javascript/rhino/Node;)Ljava/lang/String; P R Parent
T U V W X com/google/javascript/rhino/Node getParent $()Lcom/google/javascript/rhino/Node; Z [ \ makeConcatWithConstants J(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
^ _ ` throwInternalError *(Ljava/lang/String;Ljava/lang/Throwable;)V b [ c &(Ljava/lang/String;)Ljava/lang/String;
T e f g toString (ZZZ)Ljava/lang/String;
i j k formatNodePosition 6(Lcom/google/javascript/rhino/Node;)Ljava/lang/String; Z
n o p
initTraversal %(Lcom/google/javascript/rhino/Node;)V
r s p pushScope
u v w traverseBranch G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V
y z popScope | java/lang/Error ~ java/lang/Exception
? ? ? throwUnexpectedException (Ljava/lang/Throwable;)V
? ? ? builder 6()Lcom/google/javascript/jscomp/NodeTraversal$Builder;
? ? ? setCompiler e(Lcom/google/javascript/jscomp/AbstractCompiler;)Lcom/google/javascript/jscomp/NodeTraversal$Builder;
? ? ? setCallback k(Lcom/google/javascript/jscomp/NodeTraversal$Callback;)Lcom/google/javascript/jscomp/NodeTraversal$Builder;
? ? p traverse
? ? ?
checkState (Z)V
? ? w
traverseRoots
? ? k getBestSourceFileName ? [source unknown]
T ? ? ? getLineno ()I
T ? ? ? getCharno
? ? ?
getSourceLine '(Ljava/lang/String;I)Ljava/lang/String; ? [source unknown] ? [ ? :(Ljava/lang/String;IILjava/lang/String;)Ljava/lang/String;
? ? ? ? ? *com/google/javascript/jscomp/AbstractScope isGlobal ()Z
? ? ? ?
isModuleScope
? ? ? (ZLjava/lang/Object;)V
? s ? /(Lcom/google/javascript/jscomp/AbstractScope;)V
? ? ? X getRootNode ? java/util/ArrayDeque
?
? ? W ? .()Lcom/google/javascript/jscomp/AbstractScope; ? ? ? ? ? java/util/Deque push (Ljava/lang/Object;)V ? ? ? ? isEmpty ? ? ? ? pop ()Ljava/lang/Object;
? s ? 0(Lcom/google/javascript/jscomp/AbstractScope;Z)V ? ? ? ? ? ,com/google/javascript/jscomp/NodeTraversal$1 ,$SwitchMap$com$google$javascript$rhino$Token [I
T ? ? ? getToken %()Lcom/google/javascript/rhino/Token;
? ? ? ? ? !com/google/javascript/rhino/Token ordinal $ ? ? ? shouldTraverse s(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Z
T ? ? X
getFirstChild
T ? ? X getNext
? ? ? ? ? %com/google/javascript/jscomp/NodeUtil isFunctionDeclaration %(Lcom/google/javascript/rhino/Node;)Z $ ? ? ? visit s(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V
T ? ? X getLastChild
? ? ? ? isClassExpression
p traverseChildren *Expected global or module scope. Got: (%s)
? ((ZLjava/lang/String;Ljava/lang/Object;)V
traverseWithScope Q(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/AbstractScope;)V
?
?(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/NodeTraversal$Callback;)V Fcom/google/javascript/jscomp/NodeTraversal$1TraverseScopeRootsCallback
9(ZLcom/google/javascript/jscomp/NodeTraversal$Callback;)V 1com/google/javascript/jscomp/MemoizedScopeCreator
.(Lcom/google/javascript/jscomp/ScopeCreator;)V java/util/List iterator ()Ljava/util/Iterator; !" ? java/util/Iterator hasNext$% ? next '( E scopeNode
*+, setScopeCreator a(Lcom/google/javascript/jscomp/ScopeCreator;)Lcom/google/javascript/jscomp/NodeTraversal$Builder;
./0 build .()Lcom/google/javascript/jscomp/NodeTraversal;
23 p traverseScopeRoot
56 p initScopeRoots 89:
sourceName Ljava/lang/String;
T<= A getSourceFileName
?@A
getInputId '()Lcom/google/javascript/rhino/InputId; CDE
compilerInput ,Lcom/google/javascript/jscomp/CompilerInput;
GHI getInput S(Lcom/google/javascript/rhino/InputId;)Lcom/google/javascript/jscomp/CompilerInput;
KHL .()Lcom/google/javascript/jscomp/CompilerInput;
NOPQR *com/google/javascript/jscomp/CompilerInput getChunk (()Lcom/google/javascript/jscomp/JSChunk;
TUVW ? %com/google/javascript/jscomp/Platform isThreadInterruptedY java/lang/RuntimeException[ java/lang/InterruptedException
Z
X^ ?
`a p setChangeScope
cd clearScriptState fg E currentChangeScope
ij w traverseFunction lm E currentHoistScopeRoot
op w handleScript
rs w handleFunction
uv w handleModule
xy w handleClass
{| w handleClassMembers
~ w !handleDestructuringOrDefaultValue
??? ? createsBlockScope
??? ? isClassStaticBlock ?? E currentFunction
T?? ? isComputedProp
T?? ? isComputedFieldDef
T?? ? hasTwoChildren
?? w handleMemberFieldDef? java/lang/IllegalStateException ? [? 7(Lcom/google/javascript/rhino/Token;)Ljava/lang/String;
?? ? (Ljava/lang/String;)V
??? add (Ljava/lang/Object;)Z '???
enterScope /(Lcom/google/javascript/jscomp/NodeTraversal;)V
? z ? '??? exitScope
?? ? size
??? remove (I)Ljava/lang/Object;
??? get
??? getNodeRootFromScopeObj 6(Ljava/lang/Object;)Lcom/google/javascript/rhino/Node;
?? ? getAbstractScope
???? untyped &()Lcom/google/javascript/jscomp/Scope;
???? typed +()Lcom/google/javascript/jscomp/TypedScope;
??? /(I)Lcom/google/javascript/jscomp/AbstractScope;????? )com/google/javascript/jscomp/ScopeCreator createScope |(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/AbstractScope;)Lcom/google/javascript/jscomp/AbstractScope;
??? set '(ILjava/lang/Object;)Ljava/lang/Object;
?? X getScopeRoot
?? ? isHoistScopeRootNode
??? ? isFunctionBlock
T?? ? isArrowFunction
?? ?
getScopeDepth
??? ? isModuleScopeRoot
?? ?
inGlobalScope
?? ?
inModuleScope
T?? ?
isFunction
????? $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
???? ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)Lcom/google/javascript/jscomp/JSError;
??? ? isChangeScopeRoot
?? p reportChangeToChangeScope
? p reportChangeToEnclosingScope 'java/lang/UnsupportedOperationException getCurrentScript not supported
?
T ? isScript
?
getEnclosingHoistScopeRoot F(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
? getEnclosingChangeScopeRoot
? getEnclosingFunction
getEnclosingScript
? isScopeRoot ? ? addFirst ?
T ? isRoot !"# inputId %Lcom/google/javascript/rhino/InputId;
T?
&' A
getSourceName RuntimeVisibleTypeAnnotations #Lorg/jspecify/annotations/Nullable; Signature )Ljava/util/ArrayList; MISSING_SOURCE
ConstantValue Code LineNumberTable 7(Lcom/google/javascript/jscomp/NodeTraversal$Builder;)V LocalVariableTable this ,Lcom/google/javascript/jscomp/NodeTraversal; 4Lcom/google/javascript/jscomp/NodeTraversal$Builder;
StackMapTable MethodParameters unexpectedException Ljava/lang/Throwable; message; java/lang/String label n root cb scopeRoot externs ?(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/jscomp/NodeTraversal$Callback;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V sourceFileName
lineNumber I columnNumber src s ,Lcom/google/javascript/jscomp/AbstractScope; LocalVariableTypeTable 0Lcom/google/javascript/jscomp/AbstractScope<**>; U(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/AbstractScope<**>;)V traverseAtScope fnName args body className forAssignmentParam forIterableParam forBodyScope parentScopes Ljava/util/Deque; temp CLjava/util/Deque;>; 3(Lcom/google/javascript/jscomp/AbstractScope<**>;)V traverseScopeRoots ?(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/rhino/Node;Ljava/util/List;Lcom/google/javascript/jscomp/NodeTraversal$Callback;Z)V
scopeNodes Ljava/util/List; traverseNested scb HLcom/google/javascript/jscomp/NodeTraversal$1TraverseScopeRootsCallback; 3Lcom/google/javascript/jscomp/MemoizedScopeCreator; 4Ljava/util/List; ?(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/rhino/Node;Ljava/util/List;Lcom/google/javascript/jscomp/NodeTraversal$Callback;Z)V getCompiler 1()Lcom/google/javascript/jscomp/AbstractCompiler;g #com/google/javascript/rhino/InputId inputj $com/google/javascript/jscomp/JSChunk getCurrentNode parent changeScope first second child previousHoistScopeRoot previousFunction
extendsClause node quietly 4(Lcom/google/javascript/jscomp/AbstractScope<**>;Z)V Ljava/lang/Object; roots depth getScope
getTypedScope 2()Lcom/google/javascript/jscomp/AbstractScope<**>; parentScope scope rootDepth o 3(I)Lcom/google/javascript/jscomp/AbstractScope<**>; isHoistScope getClosestHoistScopeRoot rootNode i getClosestContainerScope getClosestHoistScope )getClosestScopeRootNodeBindingThisOrSuper getScopeCreator -()Lcom/google/javascript/jscomp/ScopeCreator; inGlobalOrModuleScope inFunctionBlockScope inGlobalHoistScope inModuleHoistScope
moduleRoot e(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)V diagnosticType -Lcom/google/javascript/jscomp/DiagnosticType; arguments [Ljava/lang/String; error &Lcom/google/javascript/jscomp/JSError; ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)V start end reportCodeChange getCurrentScript
traversalRoot hoistScopeRoot enclosingFunction script queuedScopeRoot queuedScopeRoots 5Ljava/util/Deque;
SourceFile NodeTraversal.java NestMembers? 4com/google/javascript/jscomp/NodeTraversal$Builder$1? Gcom/google/javascript/jscomp/NodeTraversal$AbstractChangedScopeCallback? Acom/google/javascript/jscomp/NodeTraversal$AbstractModuleCallback? Kcom/google/javascript/jscomp/NodeTraversal$AbstractShallowStatementCallback? Bcom/google/javascript/jscomp/NodeTraversal$AbstractShallowCallback? >com/google/javascript/jscomp/NodeTraversal$AbstractCfgCallback? Acom/google/javascript/jscomp/NodeTraversal$AbstractScopedCallback? Ccom/google/javascript/jscomp/NodeTraversal$AbstractPreOrderCallback? Mcom/google/javascript/jscomp/NodeTraversal$AbstractPostOrderCallbackInterface? Bcom/google/javascript/jscomp/NodeTraversal$ExternsSkippingCallback? Dcom/google/javascript/jscomp/NodeTraversal$AbstractPostOrderCallback BootstrapMethods?
??? [? $java/lang/invoke/StringConcatFactory ?(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;?
? : NULL? (): ? ::
? Invalid class member: InnerClasses Builder Callback ScopedCallback TraverseScopeRootsCallback AbstractChangedScopeCallback AbstractModuleCallback AbstractShallowStatementCallback AbstractShallowCallback AbstractCfgCallback AbstractScopedCallback AbstractPreOrderCallback "AbstractPostOrderCallbackInterface ExternsSkippingCallback AbstractPostOrderCallback? %java/lang/invoke/MethodHandles$Lookup? java/lang/invoke/MethodHandles Lookup ! " # + , ( ) / 0 9 : J E m E ( ) ? E D E g E * + 9: ( ) "# ( ) DE ( ) ,: - ? C ? ? . ? Y? ? / ? 0 . j*? *?
Y? ?
*+? ? ? ? *+? ? ? $? &**? &? '?
*? &? '? ? )*+? -? ? 1Y*? ? 3? +? -? 6*+? 7? ;? / 2 ? D ? ? +? ,? D? E? L? Z? a? i?1 j23 j ?4 5 <