com.google.javascript.jscomp.ReplaceMessages.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
,com/google/javascript/jscomp/ReplaceMessages compiler /Lcom/google/javascript/jscomp/AbstractCompiler;
-com/google/javascript/jscomp/AbstractCompiler createAstFactory +()Lcom/google/javascript/jscomp/AstFactory;
astFactory )Lcom/google/javascript/jscomp/AstFactory; bundle ,Lcom/google/javascript/jscomp/MessageBundle; strictReplacement Z >com/google/javascript/jscomp/ReplaceMessages$MsgProtectionPass
" # 1(Lcom/google/javascript/jscomp/ReplaceMessages;)V % .com/google/javascript/jscomp/ReplaceMessages$1
$ ' ( c(Lcom/google/javascript/jscomp/ReplaceMessages;Lcom/google/javascript/jscomp/JsMessageDefinition;)V * Fcom/google/javascript/jscomp/ReplaceMessages$QuotedKeyObjectLitBuilder
) " - key
/ 0 1 2 3 &com/google/javascript/jscomp/JsMessage getKey ()Ljava/lang/String;
) 5 6 7 addString n(Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/jscomp/ReplaceMessages$QuotedKeyObjectLitBuilder;
/ 9 : 3 getAlternateId < alt_id
/ > ? 3
getMeaning A meaning C D E F G 7com/google/javascript/jscomp/ReplaceMessages$MsgOptions
isIcuTemplate ()Z I msg_text
/ K L 3 asIcuMessageString F O
/ Q R 3 asJsMessageString C T U G escapeLessThan U C X Y G unescapeHtmlEntities Y
) \ ] ^ build $()Lcom/google/javascript/rhino/Node; ` Fcom/google/javascript/jscomp/ReplaceMessages$ReplacementCompletionPass
_ "
c d e f g -com/google/javascript/jscomp/JsMessageVisitor extractObjectLiteralMap d(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/jscomp/JsMessageVisitor$ObjectLiteralMap; i j k l m >com/google/javascript/jscomp/JsMessageVisitor$ObjectLiteralMap extractAsValueMap *()Lcom/google/common/collect/ImmutableMap; o @com/google/javascript/jscomp/JsMessageVisitor$MalformedException q java/lang/IllegalStateException
p s t (Ljava/lang/Throwable;)V
/ v w 3 getId y z { | } *com/google/javascript/jscomp/MessageBundle
getMessage <(Ljava/lang/String;)Lcom/google/javascript/jscomp/JsMessage;
/ ? ? jsPlaceholderNames *()Lcom/google/common/collect/ImmutableSet;
? ? ? ? ? java/util/Objects equals '(Ljava/lang/Object;Ljava/lang/Object;)Z
? ? ? ? G &com/google/common/collect/ImmutableSet isEmpty
? ? ? isStartOfIcuMessage (Ljava/lang/String;)Z ? ? ? &INVALID_ALTERNATE_MESSAGE_PLACEHOLDERS -Lcom/google/javascript/jscomp/DiagnosticType; ? java/lang/String
? ? ? ? valueOf &(Ljava/lang/Object;)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 ? @com/google/javascript/jscomp/ReplaceMessages$FullReplacementPass
? " ? ? ?
java/util/Map
? ? ? createNodeForMsgString o(Lcom/google/javascript/jscomp/ReplaceMessages$MsgOptions;Ljava/lang/String;)Lcom/google/javascript/rhino/Node; ? TThe translated message has placeholders, but the definition in the JS code does not.
n ? ? 7(Ljava/lang/String;Lcom/google/javascript/rhino/Node;)V
/ ? ? ? getParts +()Lcom/google/common/collect/ImmutableList;
? ? ? mergeStringParts "(Ljava/util/List;)Ljava/util/List; ? ? ? java/util/List
? ? ? ? ? 'com/google/javascript/jscomp/AstFactory createString 6(Ljava/lang/String;)Lcom/google/javascript/rhino/Node; ? ? ? ? iterator ()Ljava/util/Iterator; ? ? ? ? G java/util/Iterator hasNext ? ? ? ? next ()Ljava/lang/Object; ? +com/google/javascript/jscomp/JsMessage$Part ? ? ? G
isPlaceholder ? ? ? 3 getJsPlaceholderName ? ? ? ? get &(Ljava/lang/Object;)Ljava/lang/Object; ? com/google/javascript/rhino/Node ? ? ? makeConcatWithConstants &(Ljava/lang/String;)Ljava/lang/String;
? ? ? ^ cloneTree ? ? ? 3 getString
? ? ? ? createAdd h(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node; ? < ? <
? ? ? ? replace D(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; ? > ? > ? ' ? ' ? " " & & java/util/ArrayList
?
add (Ljava/lang/Object;)Z
#com/google/common/collect/Iterables getLast ((Ljava/lang/Iterable;)Ljava/lang/Object; ? size ()I ? 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
1com/google/javascript/jscomp/JsMessage$StringPart create G(Ljava/lang/String;)Lcom/google/javascript/jscomp/JsMessage$StringPart; ?!"# set '(ILjava/lang/Object;)Ljava/lang/Object;% {
?'( ?
startsWith
?*+, indexOf (II)I. plural,
?0(1 (Ljava/lang/String;I)Z3 select,5 $JSC_BUNDLE_DOES_NOT_HAVE_THE_MESSAGE7 >Message with id = {0} could not be found in replacement bundle
9:;<= +com/google/javascript/jscomp/DiagnosticType error S(Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/jscomp/DiagnosticType; ?@ ? BUNDLE_DOES_NOT_HAVE_THE_MESSAGEB *JSC_INVALID_ALTERNATE_MESSAGE_PLACEHOLDERSD PAlternate message ID={0} placeholders ({1}) differs from {2} placeholders ({3}).F .com/google/javascript/jscomp/ReplaceMessages$2
E IJK ICU_MSG_OPTIONS 9Lcom/google/javascript/jscomp/ReplaceMessages$MsgOptions; _(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/jscomp/MessageBundle;Z)V Code LineNumberTable LocalVariableTable this .Lcom/google/javascript/jscomp/ReplaceMessages; MethodParameters getMsgProtectionPass -()Lcom/google/javascript/jscomp/CompilerPass; getMsgOptionsFromDefinition m(Lcom/google/javascript/jscomp/JsMessageDefinition;)Lcom/google/javascript/jscomp/ReplaceMessages$MsgOptions;
definition 2Lcom/google/javascript/jscomp/JsMessageDefinition; createMsgPropertiesNode ?(Lcom/google/javascript/jscomp/JsMessage;Lcom/google/javascript/jscomp/ReplaceMessages$MsgOptions;)Lcom/google/javascript/rhino/Node; message (Lcom/google/javascript/jscomp/JsMessage;
msgOptions msgPropsBuilder HLcom/google/javascript/jscomp/ReplaceMessages$QuotedKeyObjectLitBuilder; altId Ljava/lang/String;
StackMapTable getReplacementCompletionPass "extractPlaceholderValuesMapOrThrow L(Lcom/google/javascript/rhino/Node;)Lcom/google/common/collect/ImmutableMap; e BLcom/google/javascript/jscomp/JsMessageVisitor$MalformedException; valuesObjLit "Lcom/google/javascript/rhino/Node; Signature ?(Lcom/google/javascript/rhino/Node;)Lcom/google/common/collect/ImmutableMap;
lookupMessage ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/MessageBundle;Lcom/google/javascript/jscomp/JsMessage;)Lcom/google/javascript/jscomp/JsMessage; jsCodePlaceholderNames (Lcom/google/common/collect/ImmutableSet; alternateMsgPlaceholderNames callNode translatedMessage alternateId alternateMessage LocalVariableTypeTable ; RuntimeVisibleTypeAnnotations #Lorg/jspecify/annotations/Nullable; getFullReplacementPass constructStringExprNode ?(Lcom/google/javascript/jscomp/JsMessage;Ljava/util/Map;Lcom/google/javascript/jscomp/ReplaceMessages$MsgOptions;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node; icuMsgString jsPlaceholderName valueNode partNode msgPart -Lcom/google/javascript/jscomp/JsMessage$Part;
resultNode msgToUse placeholderMap Ljava/util/Map; options
nodeToReplace msgParts Ljava/util/List; ELjava/util/Map; ?Ljava/util/List;
Exceptions ?(Lcom/google/javascript/jscomp/JsMessage;Ljava/util/Map;Lcom/google/javascript/jscomp/ReplaceMessages$MsgOptions;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node; s lastPart part parts result ?(Ljava/util/List;)Ljava/util/List;
commaIndex I nextBracketIndex
SourceFile ReplaceMessages.java RuntimeInvisibleAnnotations /Lcom/google/common/annotations/GwtIncompatible; value JsMessage NestMembers? ?com/google/javascript/jscomp/ReplaceMessages$ProtectedJsMessage? Acom/google/javascript/jscomp/ReplaceMessages$ProtectedJsMessage$1? Bcom/google/javascript/jscomp/ReplaceMessages$FullReplacementPass$2? Bcom/google/javascript/jscomp/ReplaceMessages$FullReplacementPass$1? Ccom/google/javascript/jscomp/ReplaceMessages$FullReplacementMsgData? Acom/google/javascript/jscomp/ReplaceMessages$ProtectedMsgFallback? Hcom/google/javascript/jscomp/ReplaceMessages$ReplacementCompletionPass$1? @com/google/javascript/jscomp/ReplaceMessages$MsgProtectionPass$2? @com/google/javascript/jscomp/ReplaceMessages$MsgProtectionPass$1? >com/google/javascript/jscomp/ReplaceMessages$MsgProtectionData 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;? .Unrecognized message placeholder referenced: ? InnerClasses MsgProtectionPass QuotedKeyObjectLitBuilder
MsgOptions ReplacementCompletionPass ObjectLiteralMap MalformedException FullReplacementPass Part
StringPart ProtectedJsMessage FullReplacementMsgData ProtectedMsgFallback MsgProtectionData? %java/lang/invoke/MethodHandles$Lookup? java/lang/invoke/MethodHandles Lookup 1 @ ? ? ? JK
L M x *? *+? *+?
? *,? *? ? N C D E F G HO * PQ R
ST M 3 ? Y*? !? N QO PQ UV M >
? $Y*+? &? N O
PQ
WX R W YZ M G ?? )Y*? +N-,+? .? 4W+? 8:? -;? 4W+? =:? -@? 4W,? B ? -H+? J? 4W-MN? 4W? -H+? P? 4W,? S ? -VN? 4W,? W ? -ZN? 4W-? [? N F ( . 3 < E P" \$ g&