com.google.javascript.jscomp.ClosureRewriteModule.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!
???? 7d
java/lang/String replace (CC)Ljava/lang/String;
makeConcatWithConstants &(Ljava/lang/String;)Ljava/lang/String; Bcom/google/javascript/jscomp/ClosureRewriteModule$ReplaceJsDocRefs
Z(Lcom/google/javascript/jscomp/ClosureRewriteModule;Lcom/google/javascript/jscomp/Scope;)V
%com/google/javascript/rhino/JSDocInfo getTypeNodes ()Ljava/util/Collection; java/util/Collection iterator ()Ljava/util/Iterator; ! " java/util/Iterator hasNext ()Z $ % & next ()Ljava/lang/Object; ( com/google/javascript/rhino/Node
* + , - . %com/google/javascript/jscomp/NodeUtil
visitPreOrder T(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/NodeUtil$Visitor;)V
0 1 2 3 java/lang/Object ()V 5 java/util/LinkedHashMap
4 1 8 9 : ; < 1com/google/javascript/jscomp/ClosureRewriteModule syntheticExterns Ljava/util/LinkedHashMap; 8 > ? @ globalScope $Lcom/google/javascript/jscomp/Scope; B java/util/ArrayDeque
A 1 8 E F G scriptStack Ljava/util/Deque; 8 I J K
currentScript ELcom/google/javascript/jscomp/ClosureRewriteModule$ScriptDescription; M Dcom/google/javascript/jscomp/ClosureRewriteModule$GlobalRewriteState
L 1 8 P Q R rewriteState FLcom/google/javascript/jscomp/ClosureRewriteModule$GlobalRewriteState; T java/util/LinkedHashSet
S 1 8 W X Y !legacyScriptNamespacesAndPrefixes Ljava/util/Set; [ java/util/ArrayList
Z 1 8 ^ _ ` unrecognizedRequires Ljava/util/List; 8 b c d googModuleGetCalls Ljava/util/ArrayList; 8 f g d googRequireDynamicCalls
i j k l " 'com/google/javascript/jscomp/TypedScope isGlobal
n o p q r $com/google/common/base/Preconditions
checkArgument (Z)V 8 t u v compiler /Lcom/google/javascript/jscomp/AbstractCompiler;
x y z { | -com/google/javascript/jscomp/AbstractCompiler createAstFactory +()Lcom/google/javascript/jscomp/AstFactory; 8 ~ ?
astFactory )Lcom/google/javascript/jscomp/AstFactory; 8 ? ? ? preprocessorSymbolTable 6Lcom/google/javascript/jscomp/PreprocessorSymbolTable;
x ? ? ?
getOptions 0()Lcom/google/javascript/jscomp/CompilerOptions;
? ? ? ? " ,com/google/javascript/jscomp/CompilerOptions shouldPreserveGoogModule 8 ? ? ?
preserveSugar Z 8 ? ? ? globalTypedScope )Lcom/google/javascript/jscomp/TypedScope;
? ? ? ? ? 'com/google/common/collect/ImmutableList of O(Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/collect/ImmutableList;
? ? ? 2()Lcom/google/common/collect/UnmodifiableIterator;
' ? ? ?
getFirstChild $()Lcom/google/javascript/rhino/Node;
' ? ? " isScript
n ? ? ?
checkState (ZLjava/lang/Object;)V ? Fcom/google/javascript/jscomp/ClosureRewriteModule$UnwrapGoogLoadModule
? ? ? 6(Lcom/google/javascript/jscomp/ClosureRewriteModule;)V
? ? ? ? ? *com/google/javascript/jscomp/NodeTraversal traverse ?(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/NodeTraversal$Callback;)V ? Ccom/google/javascript/jscomp/ClosureRewriteModule$ScriptDescription
? 1
8 ? ? ?
pushScript H(Lcom/google/javascript/jscomp/ClosureRewriteModule$ScriptDescription;)V ? ? ? ? rootNode "Lcom/google/javascript/rhino/Node; ? ? ? ? ? java/util/Deque addLast (Ljava/lang/Object;)V ? Dcom/google/javascript/jscomp/ClosureRewriteModule$ScriptPreprocessor
? ? ? @com/google/javascript/jscomp/ClosureRewriteModule$ScriptRecorder
? ?
8 ? ? 3 popScript
' ? ? ? getNext
8 ? ? 3 reportUnrecognizedRequires
x ? ? " hasHaltingErrors ? ?com/google/javascript/jscomp/ClosureRewriteModule$ScriptUpdater
? ? ? G(Lcom/google/javascript/jscomp/ClosureRewriteModule;Ljava/util/Deque;)V
? ? ? ?
traverseRoots ?(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/jscomp/NodeTraversal$Callback;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V
8 ? ? 3 declareSyntheticExterns ? ? ? accept R(Lcom/google/javascript/jscomp/ClosureRewriteModule;)Ljava/util/function/Consumer;
Z ? ? ? forEach (Ljava/util/function/Consumer;)V ?
4 ? ? values ? ? ? stream ()Ljava/util/stream/Stream; ? ? ? test S(Lcom/google/javascript/jscomp/ClosureRewriteModule;)Ljava/util/function/Predicate; ? ? ? ? ? java/util/stream/Stream filter 9(Ljava/util/function/Predicate;)Ljava/util/stream/Stream; ? apply R(Lcom/google/javascript/jscomp/ClosureRewriteModule;)Ljava/util/function/Function; ? map 8(Ljava/util/function/Function;)Ljava/util/stream/Stream;
? toImmutableList ()Ljava/util/stream/Collector; ?
collect 0(Ljava/util/stream/Collector;)Ljava/lang/Object;
? " isEmpty
x getSynthesizedExternsInput .()Lcom/google/javascript/jscomp/CompilerInput;
*com/google/javascript/jscomp/CompilerInput
getAstRoot S(Lcom/google/javascript/jscomp/AbstractCompiler;)Lcom/google/javascript/rhino/Node;
java/util/Objects requireNonNull &(Ljava/lang/Object;)Ljava/lang/Object; " ?# A(Lcom/google/javascript/rhino/Node;)Ljava/util/function/Consumer;
? ?&'()*
java/util/Set contains (Ljava/lang/Object;)Z
,-./0 "com/google/javascript/jscomp/Scope getVar >(Ljava/lang/String;)Lcom/google/javascript/jscomp/AbstractVar;
8234 isGoogModuleExportsRef Q(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;)Z
8678 isAssignTarget %(Lcom/google/javascript/rhino/Node;)Z
':; ? getGrandparent
'=> " isExprResult ?@AB
defaultExport DLcom/google/javascript/jscomp/ClosureRewriteModule$ExportDefinition;
nD ? r
*FG8 isNamedExportsLiteral
'IJK getString ()Ljava/lang/String;
'MNO getJSDocInfo )()Lcom/google/javascript/rhino/JSDocInfo;
'QR ? removeFirstChildT exports
VWXYZ 'com/google/javascript/jscomp/AstFactory type R(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/jscomp/AstFactory$Type;
V\]^
createName d(Ljava/lang/String;Lcom/google/javascript/jscomp/AstFactory$Type;)Lcom/google/javascript/rhino/Node;
V`ab
createGetProp ?(Lcom/google/javascript/rhino/Node;Ljava/lang/String;Lcom/google/javascript/jscomp/AstFactory$Type;)Lcom/google/javascript/rhino/Node;
'def
srcrefTree F(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
Vhij createAssign h(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
'lmf srcref
'opq setJSDocInfo K(Lcom/google/javascript/rhino/JSDocInfo;)Lcom/google/javascript/rhino/Node;
stuvf com/google/javascript/rhino/IR
exprResult
'xyz insertAfter %(Lcom/google/javascript/rhino/Node;)V
'|} ? detach ?? ? isModule
'?? ? getLastChild
'?? " isStringLit 8??? INVALID_MODULE_ID_ARG -Lcom/google/javascript/jscomp/DiagnosticType;
???? report e(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)V ???? namespaceId Ljava/lang/String;
8??
toModuleContentsPrefix ???? contentsPrefix
*??f getEnclosingScript L??? 'scriptDescriptionsByGoogModuleNamespace Ljava/util/Map;?????
java/util/Map put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; L??? namespaceIdsByScriptNode $Lcom/google/common/collect/Multimap;????? "com/google/common/collect/Multimap '(Ljava/lang/Object;Ljava/lang/Object;)Z ??? ? declareLegacyNamespace
8??? 'updateLegacyScriptNamespacesAndPrefixes (Ljava/lang/String;)V&??* add
??? lastIndexOf (I)I
??? substring (II)Ljava/lang/String; 8??? INVALID_PROVIDE_NAMESPACE 8??? INVALID_PROVIDE_CALL L?? Y providedNamespaces
8??z maybeSplitMultiVar ????? 3com/google/javascript/jscomp/ClosurePrimitiveErrors INVALID_REQUIRE_NAMESPACE
L??? containsModule (Ljava/lang/String;)Z? Ecom/google/javascript/jscomp/ClosureRewriteModule$UnrecognizedRequire
?? ? 8(Lcom/google/javascript/rhino/Node;Ljava/lang/String;Z)V??? java/util/List ???? INVALID_REQUIRE_TYPE_NAMESPACE
8??? recordGoogRequire R(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Z)V
'?? " hasTwoChildren ???? !INVALID_FORWARD_DECLARE_NAMESPACE ???? INVALID_REQUIRE_DYNAMIC
Z? ???? INVALID_GET_NAMESPACE
'?? ? getParent
'?? " isAssign
'?? " isName
???? getScope &()Lcom/google/javascript/jscomp/Scope; com/google/javascript/jscomp/Var
? ? getNode
*f getRValueOfLValue 8 ? GOOG_FORWARDDECLARE
*
isCallTo G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Z
* equals
xz reportChangeToEnclosingScope
Z size ()I
Z remove (I)Ljava/lang/Object;
? com/google/common/base/Strings
isNullOrEmpty ?"# Y
topLevelNames ?
*&'( visitLhsNodesInNode B(Lcom/google/javascript/rhino/Node;Ljava/util/function/Consumer;)V
*+,-K Bcom/google/javascript/jscomp/ClosureRewriteModule$ExportDefinition getLocalName ?/0? namesToInlineByAlias?23* containsKey?5 ?78? defaultExportLocalName: 1Exports object should have been converted already ?<= ? willCreateExportsObject
*?@A newDefaultExport ?(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/jscomp/ClosureRewriteModule$ExportDefinition; ?CD? exportsToInline?FGH keySet ()Ljava/util/Set;
*JKL hasInlinableName (Ljava/util/Set;)Z
8NOP recordExportToInline G(Lcom/google/javascript/jscomp/ClosureRewriteModule$ExportDefinition;)V
?RST removeFirstChildScript G()Lcom/google/javascript/jscomp/ClosureRewriteModule$ScriptDescription;
VVWX createNumber %(D)Lcom/google/javascript/rhino/Node;
VZ[f
createVoid
']^z replaceWith` provide
'bc? setString ?ef ? hasCreatedExportObject
*hif getEnclosingStatement klmno 7com/google/javascript/jscomp/ClosureRewriteModule$AddAt AFTER 9Lcom/google/javascript/jscomp/ClosureRewriteModule$AddAt;
8qrs exportTheEmptyBinaryNamespaceAt ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/ClosureRewriteModule$AddAt;Lcom/google/javascript/jscomp/NodeTraversal;)V
Luv? isLegacyModule
*xy8 isNameDeclaration
'{| " isDestructuringLhs ~??? ;com/google/javascript/jscomp/ClosureRewriteModule$ScopeType EXEC_CONTEXT =Lcom/google/javascript/jscomp/ClosureRewriteModule$ScopeType;
8???
isTopLevel ?(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/ClosureRewriteModule$ScopeType;)Z
L??
getExportedNamespaceOrScript
8??? recordNameToInline 9(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
8??? maybeAddAliasToSymbolTable 7(Lcom/google/javascript/rhino/Node;Ljava/lang/String;)V
'?? " isObjectPattern
8??? maybeWarnForInvalidDestructuring c(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Ljava/lang/String;)V
'?? ? getFirstFirstChild
'?? " hasChildren ? ? 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; ?
8???
safeSetString? java/lang/RuntimeException ? ? 6(Lcom/google/javascript/rhino/Node;)Ljava/lang/String;
?? ?? &Unexpected non-top-level require at %s
n? ?? ((ZLjava/lang/String;Ljava/lang/Object;)V
n? q ???? get 8??? $ILLEGAL_DESTRUCTURING_DEFAULT_EXPORT ??? Y namedExports 8??? "ILLEGAL_DESTRUCTURING_NOT_EXPORTED
8??? updateGoogRequire Q(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;)V
'?? " isAwait
'?? " isGetProp? then? >goog.requireDynamic() in only allowed in await/then expression
8??z #updateGoogRequireDynamicCallInAwait
8??z "updateGoogRequireDynamicCallInThen
'?? ? getSecondChild? :Exported namespace for goog.requireDynamic() canot be null
'?? " isCall? must be a 'then' call expression
8??
namespaceIdToXid
V??? createString 6(Ljava/lang/String;)Lcom/google/javascript/rhino/Node;? goog.requireDynamic
'??? matchesQualifiedName? importHandler_
V?]? _(Lcom/google/javascript/rhino/StaticScope;Ljava/lang/String;)Lcom/google/javascript/rhino/Node;
'??? setOriginalName
'?? "
isFunction? must be a function in `then`
'??
getChildCount? %function must have only one parameter
'?? ? getOnlyChild =parameter of callback function must be object pattern or name
' ? removeChildren
?
getLanguageIn =()Lcom/google/javascript/jscomp/CompilerOptions$LanguageMode;
9com/google/javascript/jscomp/CompilerOptions$LanguageMode toFeatureSet :()Lcom/google/javascript/jscomp/parsing/parser/FeatureSet; >com/google/javascript/jscomp/parsing/parser/FeatureSet$Feature CONST_DECLARATIONS @Lcom/google/javascript/jscomp/parsing/parser/FeatureSet$Feature;
) 6com/google/javascript/jscomp/parsing/parser/FeatureSet C(Lcom/google/javascript/jscomp/parsing/parser/FeatureSet$Feature;)Z '%s' does not contain '%s'
n ? :(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
* ! addFeatureToScript ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/parsing/parser/FeatureSet$Feature;Lcom/google/javascript/jscomp/AbstractCompiler;)V
V#$j )createSingleConstObjectPatternDeclaration
'&'f srcrefTreeIfMissing
V)*+ createSingleConstNameDeclaration X(Ljava/lang/String;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
'-. " isBlock
'01z addChildToFront
V34f createReturn
V678 createBlock G([Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;: ;Exported namespace for goog.requireDynamic() cannot be null< ?Only goog.requireDynamic() in await expression is supported now 8>?? -ILLEGAL_STMT_OF_GOOG_REQUIRE_DYNAMIC_IN_AWAIT
ABCDE $com/google/javascript/jscomp/JSError make ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)Lcom/google/javascript/jscomp/JSError;
xG?H )(Lcom/google/javascript/jscomp/JSError;)V
*JK8 isStatement
VMN? createQName
LPQR getGoogModuleNamespaceType ?(Ljava/lang/String;)Lcom/google/javascript/rhino/jstype/JSType;
'TUV setJSType O(Lcom/google/javascript/rhino/jstype/JSType;)Lcom/google/javascript/rhino/Node;
Vt
'YZz insertBefore ?\]^ chunkIdHashFunction /Lcom/google/javascript/jscomp/Xid$HashFunction;` com/google/javascript/jscomp/Xid
_ 1
_c d 2(Lcom/google/javascript/jscomp/Xid$HashFunction;)V
_f?
Vhij createQNameFromTypedScope _(Lcom/google/javascript/jscomp/TypedScope;Ljava/lang/String;)Lcom/google/javascript/rhino/Node;
?lm "
inModuleScope
*opq newNamedExport ?(Lcom/google/javascript/jscomp/NodeTraversal;Ljava/lang/String;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/jscomp/ClosureRewriteModule$ExportDefinition;
?stK getExportedNamespace
8vw? safeSetMaybeQualifiedString
8yz{ markConstAndCopyJsDoc G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V k}~o BEFORE
???? .()Lcom/google/javascript/jscomp/AbstractScope;
,?? ? getRootNode
??? ? getNameNode
'?? " isStringKey 8?? ? GOOG_REQUIRE 8?? ? GOOG_REQUIRETYPE? ;com/google/javascript/jscomp/ClosureRewriteModule$AliasName ???? newName
???K getBinaryNamespace ??
??? indexOf
? j
,?? "
isModuleScope 8??? IMPORT_INLINING_SHADOWS_VAR
???K getName
'?? " isObjectLit
'?? " isComputedProp 8??? INVALID_EXPORT_COMPUTED_PROPERTY
8??? maybeUpdateExportDeclToNode s(Lcom/google/javascript/jscomp/NodeTraversal;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V
???? *com/google/javascript/jscomp/AbstractScope getDepth
,?
?M
?? " hasTypedefType
????? -com/google/javascript/rhino/JSDocInfo$Builder copyFrom X(Lcom/google/javascript/rhino/JSDocInfo;)Lcom/google/javascript/rhino/JSDocInfo$Builder;
???O build *?? ? rhs
8??? declareGlobalVariable Q(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/NodeTraversal;)V
'??? getJSType -()Lcom/google/javascript/rhino/jstype/JSType;
s??j var '??? IS_NAMESPACE 'Lcom/google/javascript/rhino/Node$Prop;
'??? putBooleanProp +(Lcom/google/javascript/rhino/Node$Prop;Z)V
8??? maybeUpdateExportObjectLiteral
'?? " isParamList
'?? " isModuleBody '??? GOOG_MODULE
'??? getBooleanProp *(Lcom/google/javascript/rhino/Node$Prop;)Z ????? !com/google/javascript/rhino/Token BLOCK #Lcom/google/javascript/rhino/Token;
'??? setToken &(Lcom/google/javascript/rhino/Token;)V
*???
tryMergeBlock &(Lcom/google/javascript/rhino/Node;Z)Z? ? *??? nameDecl "Lcom/google/javascript/jscomp/Var;
*K getExportPostfix ? ? & peek
? ? addChildScript ? ? addFirst ? & removeFirst ? & peekFirst
V8 createObjectLit
8z markConst
' " isUseStrict 8? USELESS_USE_STRICT_DIRECTIVE
' ! r setUseStrict
?#$?
maybeCopyFrom
?&' " recordConstancy
')* " isVar
',- " hasMoreThanOneChild/ .exportDefinition: %s
exportsToInline keys: %s1 /Already found a mapping for inlining export: %s
n34 checkNotNull
?6 7 '(Ljava/lang/String;Ljava/lang/String;)V? ?? ?;<