com.google.javascript.jscomp.StripCode$Strip.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? ,com/google/javascript/jscomp/StripCode$Strip this$0 (Lcom/google/javascript/jscomp/StripCode;
java/lang/Object ()V decisionsLog 1Lcom/google/javascript/jscomp/diagnostic/LogFile; (com/google/javascript/jscomp/StripCode$1 ,$SwitchMap$com$google$javascript$rhino$Token [I
com/google/javascript/rhino/Node getToken %()Lcom/google/javascript/rhino/Token;
! " !com/google/javascript/rhino/Token ordinal ()I
$ % & %isMethodOrCtorCallThatTriggersRemoval s(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Z ( ) * get ()Ljava/util/function/Supplier;
, - . / 0 /com/google/javascript/jscomp/diagnostic/LogFile log P(Ljava/util/function/Supplier;)Lcom/google/javascript/jscomp/diagnostic/LogFile;
2 3 4 replaceHighestNestedCallWithNull s(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V
6 7 4 #removeVarDeclarationsByNameOrRvalue
9 : 4 %maybeRemoveReferenceToRemovedVariable
< = 4 $maybeEliminateAssignmentByLvalueName
? @ A %eliminateKeysWithStripNamesFromObjLit Q(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;)V
C D E maybeEliminateExpressionByName %(Lcom/google/javascript/rhino/Node;)V
G H 4 "maybeEliminateClassByNameOrExtends
J K L
getFirstChild $()Lcom/google/javascript/rhino/Node;
N O L getNext
Q R S isDestructuringLhs ()Z
U V S isName
X Y Z [ \ $com/google/common/base/Preconditions
checkState (ZLjava/lang/Object;)V
^ _ ` getString ()Ljava/lang/String;
b c d e f java/lang/String lastIndexOf (I)I
b h i j substring (I)Ljava/lang/String;
l m n isStripName (Ljava/lang/String;)Z
p q r qualifiedNameBeginsWithStripType %(Lcom/google/javascript/rhino/Node;)Z
t u r &isCallWhoseReturnValueShouldBeStripped w x y z { &com/google/javascript/jscomp/StripCode varsToRemove 9Lcom/google/javascript/jscomp/base/LinkedIdentityHashMap;
} ~ ? ? 7com/google/javascript/jscomp/base/LinkedIdentityHashMap put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; ? $
b ? ? ? contains (Ljava/lang/CharSequence;)Z ? ) ? C(Ljava/lang/String;Ljava/lang/String;)Ljava/util/function/Supplier;
? ? S hasChildren
? ? L getOnlyChild
? ? E replaceWithNull
? ? ? ? L com/google/javascript/rhino/IR nullNode
? ? ? srcref F(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
? ? E addChildToFront
? ? ? ? *com/google/javascript/jscomp/NodeTraversal reportCodeChange ? ) ? 1(Ljava/lang/String;)Ljava/util/function/Supplier;
? ? L detach w ? ? ? compiler /Lcom/google/javascript/jscomp/AbstractCompiler;
? ? ? ? ? %com/google/javascript/jscomp/NodeUtil markFunctionsDeleted T(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/AbstractCompiler;)V
? ? ? replaceWithEmpty G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V
? ? ? isReferenceToRemovedVar Q(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;)Z ? ) ? A(Lcom/google/javascript/rhino/Node;)Ljava/util/function/Supplier;
? ? L getParent ?
? ? S isExprResult
? ? E replaceWith ?
? ? r isFirstChildOf ?
? ? L getLastChild
? ? S isCall
? ? S isNew ? ?
? ? S isAssign
? ? ? r isNormalGet
? ? r nameIncludesFieldNameToStrip ?
? ? ? ? E -com/google/javascript/jscomp/AbstractCompiler reportChangeToEnclosingScope w ? ? ? STRIP_ASSIGNMENT_ERROR -Lcom/google/javascript/jscomp/DiagnosticType;
? ? ` getQualifiedName
? ? ? ? report e(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)V
X ? ? \
checkArgument
?
? ? ? ? getNameNode
? ? S isQualifiedName
? q n ?
? r isStatementParent
L getSecondChild w
? STRIP_TYPE_INHERIT_ERROR
?
? #getCallTargetResolvingIndirectCalls w stripTypesList [Ljava/lang/String;
b equals (Ljava/lang/Object;)Z equals strip type
logStripName '(Ljava/lang/String;Ljava/lang/String;)V w stripTypePrefixesList
b!" n
startsWith$ starts with strip type prefix& does not begin with a strip type
() logNotAStripName
}+ ), &(Ljava/lang/Object;)Ljava/lang/Object;
?./ r isNameDeclaration
12 ? actsOnStripType
45 S isGetProp
b78 f indexOf: \$
b<=> split '(Ljava/lang/String;)[Ljava/lang/String;
?@AB getCodingConvention 1()Lcom/google/javascript/jscomp/CodingConvention;DEFGH -com/google/javascript/jscomp/CodingConvention getClassesDefinedByCall h(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/jscomp/CodingConvention$SubclassRelationship; JKLMN Bcom/google/javascript/jscomp/CodingConvention$SubclassRelationship subclassName Ljava/lang/String;P class defining call JRSN superclassName wUVW stripNameSuffixes (Lcom/google/common/collect/ImmutableSet;
YZ[ ? &com/google/common/collect/ImmutableSet] matches a suffix w_`W stripNamePrefixesb matches a prefix
bde S isEmpty
bghi charAt (I)C
klmno java/lang/Character isUpperCase (C)Zq empty or starts with uppercase stuvw java/util/Locale ROOT Ljava/util/Locale;
byz{ toLowerCase &(Ljava/util/Locale;)Ljava/lang/String; w}~ stripNamePrefixesLowerCaseList ?
?? 2(Ljava/lang/String;Ljava/util/function/Supplier;)V w?? stripNameSuffixesLowerCaseList
b?? n endsWith
??
no matches
,?? S isLogging ? ? ? )? N(Ljava/lang/String;Ljava/util/function/Supplier;)Ljava/util/function/Supplier; ? ?
??? ? removeChild
?? ` getLocation ??? makeConcatWithConstants &(Ljava/lang/String;)Ljava/lang/String; ???? )? java/util/function/Supplier ()Ljava/lang/Object; ??? 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; ? ? ? ? ? ? ? ? ? ? ? !? "? #?? removing function call? 3com/google/javascript/jscomp/NodeTraversal$Callback \(Lcom/google/javascript/jscomp/StripCode;Lcom/google/javascript/jscomp/diagnostic/LogFile;)V Code LineNumberTable LocalVariableTable this .Lcom/google/javascript/jscomp/StripCode$Strip; MethodParameters shouldTraverse t ,Lcom/google/javascript/jscomp/NodeTraversal; n "Lcom/google/javascript/rhino/Node; parent
StackMapTable visit name lastDollarSign I possibleStripName nameNode next greatGrandparent rvalue grandparent isLastChild Z parentIsCallee isSafeToRemove node ancestor
ancestorChild ancestorParent lvalue
expression key className classNode superclassNode function RuntimeVisibleTypeAnnotations #Lorg/jspecify/annotations/Nullable; type callee part
nameString callNode classes DLcom/google/javascript/jscomp/CodingConvention$SubclassRelationship; stripName lcName reason reasonSupplier Ljava/util/function/Supplier; LocalVariableTypeTable 1Ljava/util/function/Supplier; Signature F(Ljava/lang/String;Ljava/util/function/Supplier;)V lambda$replaceWithEmpty$18 6(Lcom/google/javascript/rhino/Node;)Ljava/lang/String; lambda$replaceWithNull$17 lambda$logStripName$16 C(Ljava/lang/String;Ljava/util/function/Supplier;)Ljava/lang/String; lambda$logStripName$15 lambda$logNotAStripName$14 lambda$isStripName$13 lambda$isStripName$12 ,lambda$maybeEliminateClassByNameOrExtends$11 (lambda$maybeEliminateExpressionByName$10 -lambda$maybeEliminateAssignmentByLvalueName$9 .lambda$maybeRemoveReferenceToRemovedVariable$8 .lambda$maybeRemoveReferenceToRemovedVariable$7 .lambda$maybeRemoveReferenceToRemovedVariable$6 .lambda$maybeRemoveReferenceToRemovedVariable$5 .lambda$maybeRemoveReferenceToRemovedVariable$4 .lambda$maybeRemoveReferenceToRemovedVariable$3 ,lambda$removeVarDeclarationsByNameOrRvalue$2 ,lambda$removeVarDeclarationsByNameOrRvalue$1 lambda$shouldTraverse$0
SourceFile StripCode.java NestHost BootstrapMethods
"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;?
` `
?
?!
"?$
%?'
(?*
+?-
.?0
1?3
4 ?6
7??9
:??<
=???
@??B
C??E
F??H
I??K
L??N
O??Q
RST?U $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;W replace with empty: Y replace with null: [ strip name: ] not a strip name: _ matches lc suffix: a matches lc prefix: c : removing classe *: removing property declaration statementg : removing assignment statementi : replacing reference with nullk .: replacing reference in comma expr with nullm *: replacing parameter reference with nullo $: replacing rhs reference with nullq &: removing assignment to stripped vars &: removing getelem/getprop/call chainu : removing declarationw : initialize with null () InnerClasses Strip SubclassRelationship Callback} %java/lang/invoke/MethodHandles$Lookup java/lang/invoke/MethodHandles Lookup ? * ? ? K *+? *? *,?
? ? ? ? ?? ?? ? ? &