com.google.javascript.jscomp.RewriteJsonToModule.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?
Dcom/google/javascript/jscomp/NodeTraversal$AbstractPostOrderCallback ()V
0com/google/javascript/jscomp/RewriteJsonToModule compiler /Lcom/google/javascript/jscomp/AbstractCompiler; java/util/LinkedHashMap
packageJsonMainEntries Ljava/util/Map;
&com/google/common/collect/ImmutableMap copyOf 9(Ljava/util/Map;)Lcom/google/common/collect/ImmutableMap;
com/google/javascript/rhino/Node isScript ()Z
! " # $ % $com/google/common/base/Preconditions
checkState (Z)V
' ( ) * + *com/google/javascript/jscomp/NodeTraversal traverse ?(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/NodeTraversal$Callback;)V - . / 0 1 2com/google/javascript/jscomp/RewriteJsonToModule$1 ,$SwitchMap$com$google$javascript$rhino$Token [I
3 4 5 getToken %()Lcom/google/javascript/rhino/Token;
7 8 9 : ; !com/google/javascript/rhino/Token ordinal ()I
= > hasOneChild @ A B JSON_UNEXPECTED_TOKEN -Lcom/google/javascript/jscomp/DiagnosticType; D java/lang/String
F G H I J $com/google/javascript/jscomp/JSError make ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)Lcom/google/javascript/jscomp/JSError;
L M N O P -com/google/javascript/jscomp/AbstractCompiler report )(Lcom/google/javascript/jscomp/JSError;)V
R S T visitScript Q(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;)V
V W isQuotedStringKey
Y Z ; getLineno
\ ] ; getCharno
_ ` a setLinenoCharno &(II)Lcom/google/javascript/rhino/Node;
' c d reportCodeChange
f g h
getFirstChild $()Lcom/google/javascript/rhino/Node;
j k isExprResult
m n o p q %com/google/javascript/rhino/JSDocInfo builder 1()Lcom/google/javascript/rhino/JSDocInfo$Builder; s #Suppresses undefined var goog error
u v w x y -com/google/javascript/rhino/JSDocInfo$Builder recordFileOverview (Ljava/lang/String;)Z {
undefinedVars
u } ~ recordSuppression (Ljava/lang/String;)V
u ? ? ? build )()Lcom/google/javascript/rhino/JSDocInfo;
? ? ? setJSDocInfo K(Lcom/google/javascript/rhino/JSDocInfo;)Lcom/google/javascript/rhino/Node;
? ? h getFirstFirstChild
? ? h detach
? ? h removeFirstChild
' ? ? ? getInput .()Lcom/google/javascript/jscomp/CompilerInput;
? ? ? ? ? *com/google/javascript/jscomp/CompilerInput getPath =()Lcom/google/javascript/jscomp/deps/ModuleLoader$ModulePath;
? ? ? ? ? 9com/google/javascript/jscomp/deps/ModuleLoader$ModulePath toModuleName ()Ljava/lang/String;
? ? ? ? ? com/google/javascript/rhino/IR name 6(Ljava/lang/String;)Lcom/google/javascript/rhino/Node;
? ? ? srcref F(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
? ? ? ? var h(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
? ? ? addChildToFront %(Lcom/google/javascript/rhino/Node;)V ? goog ? provide
? ? ? ? getprop X(Lcom/google/javascript/rhino/Node;Ljava/lang/String;)Lcom/google/javascript/rhino/Node;
? ? ? ? string
? ? ? ? call i(Lcom/google/javascript/rhino/Node;[Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
? ? ? ?
exprResult
? ? ? srcrefTreeIfMissing
? ? ? ?
getSourceFile +()Lcom/google/javascript/jscomp/SourceFile;
? ? ? ? ? 'com/google/javascript/jscomp/SourceFile getName ?
/package.json
C ? ? y endsWith
? ? isObjectLit
L ? ? ?
getOptions 0()Lcom/google/javascript/jscomp/CompilerOptions;
? ? ? ? ? ,com/google/javascript/jscomp/CompilerOptions getPackageJsonEntryNames ()Ljava/util/List; ? ? ? ? ? java/util/List iterator ()Ljava/util/Iterator; ? ? ? ? java/util/Iterator hasNext ? ? ? ? next ()Ljava/lang/Object;
? ? ? ? ? %com/google/javascript/jscomp/NodeUtil getFirstPropMatchingKey
? ? isStringLit
C ? ? ; length ? package.json
C substring (II)Ljava/lang/String;
? getString makeConcatWithConstants 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
java/util/Map put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; browser
C equals (Ljava/lang/Object;)Z
! $ (ZLjava/lang/Object;)V
processBrowserFieldAdvancedUsage 7(Ljava/lang/String;Lcom/google/javascript/rhino/Node;)V
isStringKey
!" isFalse$ .com/google/javascript/jscomp/deps/ModuleLoader& ./
C() y
startsWith
C+, (I)Ljava/lang/String;. $jscomp$browser$skiplisted
01 h getNext3 JSC_JSON_UNEXPECTED_TOKEN5 Unexpected JSON token
789:; +com/google/javascript/jscomp/DiagnosticType error S(Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/jscomp/DiagnosticType;= )com/google/javascript/jscomp/CompilerPass Signature 5Ljava/util/Map; 2(Lcom/google/javascript/jscomp/AbstractCompiler;)V Code LineNumberTable LocalVariableTable this 2Lcom/google/javascript/jscomp/RewriteJsonToModule; MethodParameters getPackageJsonMainEntries *()Lcom/google/common/collect/ImmutableMap; P()Lcom/google/common/collect/ImmutableMap; 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 t ,Lcom/google/javascript/jscomp/NodeTraversal; n parent
StackMapTable dirName Ljava/lang/String; entry entryName possibleMainEntries Ljava/util/List; jsdoc /Lcom/google/javascript/rhino/JSDocInfo$Builder;
jsonObject
moduleName inputPath LocalVariableTypeTable $Ljava/util/List; value path replacement child
SourceFile RewriteJsonToModule.java NestMembers BootstrapMethodsm
nopq $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;s InnerClasses AbstractPostOrderCallbackw 3com/google/javascript/jscomp/NodeTraversal$Callback Callback Builder
ModulePath| %java/lang/invoke/MethodHandles$Lookup~ java/lang/invoke/MethodHandles Lookup ! <