com.google.javascript.jscomp.ReplaceStrings.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!
???? 7K
Dcom/google/javascript/jscomp/NodeTraversal$AbstractPostOrderCallback ()V java/util/LinkedHashMap
+com/google/javascript/jscomp/ReplaceStrings functions Ljava/util/Map; results compiler /Lcom/google/javascript/jscomp/AbstractCompiler;
java/lang/String isEmpty ()Z ` ! " placeholderToken Ljava/lang/String;
$ % & createNameGenerator 5()Lcom/google/javascript/jscomp/DefaultNameGenerator; ( ) *
nameGenerator 3Lcom/google/javascript/jscomp/DefaultNameGenerator;
, - . parseConfiguration (Ljava/util/List;)V 0 1 2 3 4
java/util/Map values ()Ljava/util/Collection; 6 7 8 USED_RESULTS "Lcom/google/common/base/Predicate;
: ; < = > #com/google/common/collect/Iterables filter L(Ljava/lang/Iterable;Lcom/google/common/base/Predicate;)Ljava/lang/Iterable;
@ A B C D 'com/google/common/collect/ImmutableList copyOf ?(Ljava/lang/Iterable;)Lcom/google/common/collect/ImmutableList;
F G H I J &com/google/common/collect/ImmutableMap builder 2()Lcom/google/common/collect/ImmutableMap$Builder; L M N O P java/lang/Iterable iterator ()Ljava/util/Iterator; R S T U java/util/Iterator hasNext R W X Y next ()Ljava/lang/Object; [ 2com/google/javascript/jscomp/ReplaceStrings$Result Z ] ^ " replacement Z ` a " original
c d e f g .com/google/common/collect/ImmutableMap$Builder put V(Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/collect/ImmutableMap$Builder; i (com/google/javascript/jscomp/VariableMap
c k l m buildOrThrow *()Lcom/google/common/collect/ImmutableMap;
h o p (Ljava/util/Map;)V
r s t u v *com/google/javascript/jscomp/NodeTraversal traverse ?(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/NodeTraversal$Callback;)V x y z { | -com/google/javascript/jscomp/ReplaceStrings$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
~ ? ? ?
getFirstChild $()Lcom/google/javascript/rhino/Node;
~ ? ? ? getOriginalQualifiedName ()Ljava/lang/String;
~ ? ? ? getSourceFileName
? ? ? findMatching Z(Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/jscomp/ReplaceStrings$Config;
? ? ? doSubstitutions ?(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/jscomp/ReplaceStrings$Config;Lcom/google/javascript/rhino/Node;)V 0 ? ? ? get &(Ljava/lang/Object;)Ljava/lang/Object; ? 2com/google/javascript/jscomp/ReplaceStrings$Config
? ? ? replace (CC)Ljava/lang/String; ? ? ? ? excludedFilenameSuffixes (Lcom/google/common/collect/ImmutableSet;
? ? ? O ? &com/google/common/collect/ImmutableSet 2()Lcom/google/common/collect/UnmodifiableIterator;
? ? ? endsWith (Ljava/lang/String;)Z
~ ? ? isTaggedTemplateLit ? ? ? "STRING_REPLACEMENT_TAGGED_TEMPLATE -Lcom/google/javascript/jscomp/DiagnosticType;
? ? ? ? ? $com/google/javascript/jscomp/JSError make ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)Lcom/google/javascript/jscomp/JSError;
? ? ? ? ? -com/google/javascript/jscomp/AbstractCompiler report )(Lcom/google/javascript/jscomp/JSError;)V
~ ? ? isNew
~ ? ? isCall
? ? ? ? ? $com/google/common/base/Preconditions
checkState (Z)V
? ? ? isReplaceAll ? ? ? ?
parameters Ljava/util/List; ? M ? java/util/List ? java/lang/Integer
? ? ? ? intValue
~ ? ? ? getChildAtIndex %(I)Lcom/google/javascript/rhino/Node;
? ? ? replaceExpression r(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
~ ? ? ? getSecondChild
~ ? ? ? getNext
~ ? ? ? getString
? ? ? getReplacement &(Ljava/lang/String;)Ljava/lang/String;
? ? ? ? ? com/google/javascript/rhino/IR string 6(Ljava/lang/String;)Lcom/google/javascript/rhino/Node; ? java/lang/StringBuilder
?
buildReplacement ?(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;Ljava/lang/StringBuilder;)Lcom/google/javascript/rhino/Node;
? ? toString
equals (Ljava/lang/Object;)Z
~
setString (Ljava/lang/String;)V
? ? checkNotNull
recordReplacement
~ srcrefTreeIfMissing F(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
~ replaceWith %(Lcom/google/javascript/rhino/Node;)V
r reportCodeChange
"#$% ? 1com/google/javascript/jscomp/DefaultNameGenerator generateNextName
Z' ( '(Ljava/lang/String;Ljava/lang/String;)V 0* f+ 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; Z-./ didReplacement Z
~12 ? getCookedString
?456 append -(Ljava/lang/String;)Ljava/lang/StringBuilder;8 java/lang/IllegalStateException :;< makeConcatWithConstants 6(Lcom/google/javascript/rhino/Node;)Ljava/lang/String;
7>
r@AB getScope &()Lcom/google/javascript/jscomp/Scope;
DEFGH "com/google/javascript/jscomp/Scope getVar >(Ljava/lang/String;)Lcom/google/javascript/jscomp/AbstractVar;J com/google/javascript/jscomp/Var
ILM isDeclaredOrInferredConst
IOP isConst
IRS ? getInitialValue
?U5V 3(Ljava/lang/CharSequence;)Ljava/lang/StringBuilder;
?XYZ add h(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
~\] ? cloneTree
_ -` H(Ljava/lang/String;)Lcom/google/javascript/jscomp/ReplaceStrings$Config; ?bc " name
efg indexOf (I)Ii :!
kfl (Ljava/lang/String;)In .prototype.
pqr contains (Ljava/lang/CharSequence;)Z tu ? BAD_REPLACEMENT_CONFIGURATIONw 3Cannot replace strings passed to prototype methods.
?y ?z h(Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)Lcom/google/javascript/jscomp/JSError;
|}~ substring (II)Ljava/lang/String;? java/util/ArrayList
????? com/google/common/base/Splitter on $(C)Lcom/google/common/base/Splitter;
???? splitToList *(Ljava/lang/CharSequence;)Ljava/util/List;? * ??? ? size
???? valueOf (I)Ljava/lang/Integer; ??Y? ? ??q? Unknown marker (%s)
?? ?? ((ZLjava/lang/String;Ljava/lang/Object;)V ?
???? of *()Lcom/google/common/collect/ImmutableSet;
?? ? length
?}? (I)Ljava/lang/String;? ,
??? split '(Ljava/lang/String;)[Ljava/lang/String;
?? C? =([Ljava/lang/Object;)Lcom/google/common/collect/ImmutableSet;
?? ? M(Ljava/lang/String;Ljava/util/List;Lcom/google/common/collect/ImmutableSet;)V
"? ? &(Ljava/util/Set;Ljava/lang/String;[C)V? !JSC_BAD_REPLACEMENT_CONFIGURATION? (Bad replacement configuration "{0}": {1}
????? +com/google/javascript/jscomp/DiagnosticType error S(Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/jscomp/DiagnosticType;? &JSC_STRING_REPLACEMENT_TAGGED_TEMPLATE? CCannot string-replace arguments of a template literal tag function.
???? warning ??? apply $()Lcom/google/common/base/Predicate;? )com/google/javascript/jscomp/CompilerPass DEFAULT_PLACEHOLDER_TOKEN
ConstantValue EXCLUSION_PREFIX REPLACE_ONE_MARKER REPLACE_ALL_MARKER Signature WLjava/util/Map; WLjava/util/Map; XLcom/google/common/base/Predicate; T(Lcom/google/javascript/jscomp/AbstractCompiler;Ljava/lang/String;Ljava/util/List;)V Code LineNumberTable LocalVariableTable this -Lcom/google/javascript/jscomp/ReplaceStrings; functionsToInspect LocalVariableTypeTable $Ljava/util/List;
StackMapTable MethodParameters h(Lcom/google/javascript/jscomp/AbstractCompiler;Ljava/lang/String;Ljava/util/List;)V getResult ()Ljava/util/List; H()Ljava/util/List; getStringMap ,()Lcom/google/javascript/jscomp/VariableMap; result 4Lcom/google/javascript/jscomp/ReplaceStrings$Result; map 0Lcom/google/common/collect/ImmutableMap$Builder; VLcom/google/common/collect/ImmutableMap$Builder; process G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V externs "Lcom/google/javascript/rhino/Node; root visit s(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V config 4Lcom/google/javascript/jscomp/ReplaceStrings$Config; calledFn t ,Lcom/google/javascript/jscomp/NodeTraversal; n parent excludedSuffix callsiteSourceFileName RuntimeVisibleTypeAnnotations #Lorg/jspecify/annotations/Nullable; arg parameter I
firstParam replacementString
keyBuilder Ljava/lang/StringBuilder; keyNode expr key left right child
newKeyNode
newKeyBuilder initialValue var "Lcom/google/javascript/jscomp/Var; prefix function '(Ljava/util/List;)V param first last colon params
paramCount replacementParameters parts %Ljava/util/List;
namePrefix
reservedChars [C lambda$static$0 7(Lcom/google/javascript/jscomp/ReplaceStrings$Result;)Z
SourceFile ReplaceStrings.java NestMembers 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;1 Unexpected TEMPLATELIT child: 3
45678 "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;;
<#$$ InnerClasses AbstractPostOrderCallback Builder ResultC 3com/google/javascript/jscomp/NodeTraversal$Callback Callback ConfigG %java/lang/invoke/MethodHandles$LookupI java/lang/invoke/MethodHandles Lookup ? u ? ? ? ? " ? ? " ? h ! " ? " ? ? ? " ? ? ? ? ) * ? ? 7 8 ? ? ? ? ? =*? *? Y? ?
*? Y? ? *+? *,? ? ? ,? *? #? '*-? +? ? &