com.google.javascript.jscomp.ProcessDefines.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 java/util/LinkedHashSet
+com/google/javascript/jscomp/ProcessDefines knownDefineJsdocs Ljava/util/LinkedHashSet; knownGoogDefineCalls java/util/LinkedHashMap
defineByDefineName Ljava/util/LinkedHashMap; #replacementValuesFromClosureDefines validDefineValueExpressions ! " # $ % 3com/google/javascript/jscomp/ProcessDefines$Builder mode 2Lcom/google/javascript/jscomp/ProcessDefines$Mode; " ! ( ) * compiler /Lcom/google/javascript/jscomp/AbstractCompiler; ( - . / 0 1 0com/google/javascript/jscomp/ProcessDefines$Mode check Z
3 4 5 6 7 -com/google/javascript/jscomp/AbstractCompiler getTypeRegistry 5()Lcom/google/javascript/rhino/jstype/JSTypeRegistry; 9 : ; registry 3Lcom/google/javascript/rhino/jstype/JSTypeRegistry; ! = > ? replacementValues Ljava/util/Map;
A B C D E &com/google/common/collect/ImmutableMap copyOf 9(Ljava/util/Map;)Lcom/google/common/collect/ImmutableMap; G H I replacementValuesFromFlags (Lcom/google/common/collect/ImmutableMap; ! K L M namespaceSupplier Ljava/util/function/Supplier; K ! P Q 1 recognizeClosureDefines P
T U V
initNamespace G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V
X Y Z collectDefines %(Lcom/google/javascript/rhino/Node;)V
\ ] Z reportInvalidDefineLocations
_ ` "collectValidDefineValueExpressions
b c validateDefineDeclarations
e f overrideDefines
h i j keySet ()Ljava/util/Set;
l m n D o &com/google/common/collect/ImmutableSet @(Ljava/util/Collection;)Lcom/google/common/collect/ImmutableSet; q r s t u java/util/function/Supplier get ()Ljava/lang/Object; w ,com/google/javascript/jscomp/GlobalNamespace y z { namespace .Lcom/google/javascript/jscomp/GlobalNamespace;
v } ~ v(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V - ? ? 1 optimize
? ? ? values ()Ljava/util/Collection; ? ? ? ? ? java/util/Collection iterator ()Ljava/util/Iterator; ? ? ? ? ? java/util/Iterator hasNext ()Z ? ? ? u next ? 2com/google/javascript/jscomp/ProcessDefines$Define ? ? ? ? valueParent "Lcom/google/javascript/rhino/Node;
? ? ? getReplacementForDefine X(Lcom/google/javascript/jscomp/ProcessDefines$Define;)Lcom/google/javascript/rhino/Node; ? ? ? ? value
? ? ? ? ? com/google/javascript/rhino/Node getToken %()Lcom/google/javascript/rhino/Token;
? ? ? ? isEquivalentTo %(Lcom/google/javascript/rhino/Node;)Z
? ? ? ? cloneTree $()Lcom/google/javascript/rhino/Node;
? ? ? Z addChildToBack
? ? ? Z replaceWith
3 ? ? Z reportChangeToEnclosingScope
A ? i ? *()Lcom/google/common/collect/ImmutableSet;
? ? ? ? ? com/google/common/collect/Sets union H(Ljava/util/Set;Ljava/util/Set;)Lcom/google/common/collect/Sets$SetView; ? ? ?
KNOWN_DEFINES (Lcom/google/common/collect/ImmutableSet;
? ? ? ?
difference ? ? ?
java/util/Set ? java/lang/String ? ? ? UNKNOWN_DEFINE_WARNING -Lcom/google/javascript/jscomp/DiagnosticType;
? ? ? ? ? $com/google/javascript/jscomp/JSError make h(Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)Lcom/google/javascript/jscomp/JSError;
3 ? ? ? report )(Lcom/google/javascript/jscomp/JSError;)V ? ? ? ?
defineName Ljava/lang/String;
A ? t ? &(Ljava/lang/Object;)Ljava/lang/Object;
?
? ? ? isGoogDefineCall
? ? ? ?
getChildCount ()I
? ? ? ? getChildAtIndex %(I)Lcom/google/javascript/rhino/Node;
? ? ? ? ? 1com/google/javascript/rhino/jstype/JSTypeRegistry #evaluateTypeExpressionInGlobalScope [(Lcom/google/javascript/rhino/JSTypeExpression;)Lcom/google/javascript/rhino/jstype/JSType;
? ? ? ? ? )com/google/javascript/rhino/jstype/JSType
isUnknownType ? ? ? ? ? /com/google/javascript/rhino/jstype/JSTypeNative NUMBER_STRING_BOOLEAN 1Lcom/google/javascript/rhino/jstype/JSTypeNative;
?
getNativeType ^(Lcom/google/javascript/rhino/jstype/JSTypeNative;)Lcom/google/javascript/rhino/jstype/JSType;
? isSubtypeOf .(Lcom/google/javascript/rhino/jstype/JSType;)Z
*com/google/javascript/jscomp/NodeTraversal builder 6()Lcom/google/javascript/jscomp/NodeTraversal$Builder;
2com/google/javascript/jscomp/NodeTraversal$Builder setCompiler e(Lcom/google/javascript/jscomp/AbstractCompiler;)Lcom/google/javascript/jscomp/NodeTraversal$Builder; Ccom/google/javascript/jscomp/ProcessDefines$ClosureDefinesCollector
0(Lcom/google/javascript/jscomp/ProcessDefines;)V
setCallback k(Lcom/google/javascript/jscomp/NodeTraversal$Callback;)Lcom/google/javascript/jscomp/NodeTraversal$Builder;
Z traverse
v!" ?
getAllSymbols$ 1com/google/javascript/jscomp/GlobalNamespace$Name
&'( selectDefineDeclaration g(Lcom/google/javascript/jscomp/GlobalNamespace$Name;)Lcom/google/javascript/jscomp/GlobalNamespace$Ref;
#*+ ? getTotalSets
-./ getValueParentForDefine V(Lcom/google/javascript/jscomp/GlobalNamespace$Ref;)Lcom/google/javascript/rhino/Node;
?12 ? getLastChild
45 ? verifyGoogDefine
?78 ? getSecondChild
?:;< getString ()Ljava/lang/String;
#>?< getFullName
?A B ?(Ljava/lang/String;Lcom/google/javascript/jscomp/GlobalNamespace$Name;Lcom/google/javascript/jscomp/GlobalNamespace$Ref;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)V
DEF putIfAbsent 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; ?HIJ declaration 2Lcom/google/javascript/jscomp/GlobalNamespace$Ref; ?LMN name 3Lcom/google/javascript/jscomp/GlobalNamespace$Name;
#PQ ? getRefsS 0com/google/javascript/jscomp/GlobalNamespace$Ref
RUV ? isSet
XYZ equals (Ljava/lang/Object;)Z
R\] ? getNode _` ? NON_CONST_DEFINE
?bc< getLocation
?e ?f ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/DiagnosticType;[Ljava/lang/String;)Lcom/google/javascript/jscomp/JSError;
Rhi ? isSetFromGlobal
?kl ? isQualifiedName
nopqr %com/google/javascript/jscomp/NodeUtil getBestJSDocInfo K(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/JSDocInfo;
tuvw ? %com/google/javascript/rhino/JSDocInfo isDefine
yzZ add
?|} ? getParent
?? ? isVar
??? ? isConst
??? ? isName
????? $com/google/common/base/Preconditions
checkState (ZLjava/lang/Object;)V
??? ? isAssign
??? ? isFirstChildOf ???? stream ()Ljava/util/stream/Stream; ??? test ()Ljava/util/function/Predicate;????? java/util/stream/Stream filter 9(Ljava/util/function/Predicate;)Ljava/util/stream/Stream; ? t? ()Ljava/util/function/Supplier;
????? java/util/stream/Collectors toCollection ;(Ljava/util/function/Supplier;)Ljava/util/stream/Collector;???? collect 0(Ljava/util/stream/Collector;)Ljava/lang/Object;
??Z remove ? ??? apply ()Ljava/util/function/Function;???? map 8(Ljava/util/function/Function;)Ljava/util/stream/Stream;
???? ? java/util/Objects requireNonNull ??? accept 8(Ljava/util/LinkedHashSet;)Ljava/util/function/Consumer;???? forEachOrdered (Ljava/util/function/Consumer;)V
?
#??? getDeclaration 4()Lcom/google/javascript/jscomp/GlobalNamespace$Ref;
??? getConstantDeclValue F(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node; ????? -com/google/javascript/jscomp/ProcessDefines$1 0$SwitchMap$com$google$javascript$jscomp$base$Tri [I
??? isValidDefineValue K(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/jscomp/base/Tri;
???? ? %com/google/javascript/jscomp/base/Tri ordinal
?? ? size
???
hasValidValue 7(Lcom/google/javascript/jscomp/ProcessDefines$Define;)Z
????F "com/google/common/base/MoreObjects firstNonNull ?? ? INVALID_DEFINE_VALUE
t??? getType 0()Lcom/google/javascript/rhino/JSTypeExpression;
??? isValidDefineType 1(Lcom/google/javascript/rhino/JSTypeExpression;)Z ?? ? INVALID_DEFINE_TYPE ??? visit ~(Lcom/google/javascript/jscomp/ProcessDefines;)Lcom/google/javascript/jscomp/NodeTraversal$AbstractPostOrderCallbackInterface;
?? ?(Lcom/google/javascript/jscomp/NodeTraversal$AbstractPostOrderCallbackInterface;)Lcom/google/javascript/jscomp/NodeTraversal$Builder;
? ? isStringKey
? ? isStringLit
? isValidClosureDefinesValue
Z containsKey
? CLOSURE_DEFINES_MULTIPLE
F put ? CLOSURE_DEFINES_ERROR ?? ,$SwitchMap$com$google$javascript$rhino$Token
? !com/google/javascript/rhino/Token
? ?
getFirstChild
? ? isNumber
?"# ?
isFromExterns
?%&' toBoolean (Z)Z ?)*+ FALSE 'Lcom/google/javascript/jscomp/base/Tri; ?-.+ TRUE
?012 and P(Lcom/google/javascript/jscomp/base/Tri;)Lcom/google/javascript/jscomp/base/Tri;
45Z contains ?78+ UNKNOWN
?:;< hasXChildren (I)Z
t>? ?
isConstant
?AB ? isGetProp
?DE ? getNext
?GH ? isCall JK ? GOOG_DEFINE
?MN ? matchesQualifiedName
nPQ? getEnclosingFunction STUV ? 3com/google/javascript/jscomp/ClosurePrimitiveErrors INVALID_CLOSURE_CALL_SCOPE_ERROR
?XY ? isExprResult
n[\ ? isNameDeclaration ^_ ? DEFINE_CALL_WITHOUT_ASSIGNMENT
abc
verifyNotNull G(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Z efg STRINGLIT #Lcom/google/javascript/rhino/Token;
ijk verifyOfType j(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Token;)Z
mnc verifyIsLast
3pqr
getOptions 0()Lcom/google/javascript/jscomp/CompilerOptions;
tuvwx ,com/google/javascript/jscomp/CompilerOptions
getLanguageIn =()Lcom/google/javascript/jscomp/CompilerOptions$LanguageMode;
z{|}~ 9com/google/javascript/jscomp/CompilerOptions$LanguageMode toFeatureSet :()Lcom/google/javascript/jscomp/parsing/parser/FeatureSet;
n??? isValidQualifiedName M(Lcom/google/javascript/jscomp/parsing/parser/FeatureSet;Ljava/lang/String;)Z ?? ? INVALID_DEFINE_NAME_ERROR
???? getJSDocInfo )()Lcom/google/javascript/rhino/JSDocInfo; ?? ? MISSING_DEFINE_ANNOTATION S?? ? NULL_ARGUMENT_ERROR
???< getQualifiedName S?? ? TOO_MANY_ARGUMENTS_ERROR S?? ? INVALID_ARGUMENT_ERROR ?? ? INVALID_DEFINE_LOCATION? CLOSURE_DEFINES
???? matchesName (Ljava/lang/String;)Z
??? ? isGetElem
n??? getEnclosingScopeRoot
??? ? isRoot ?? ? NON_GLOBAL_CLOSURE_DEFINES_ERROR? COMPILED?
goog.DEBUG? $jscomp.ASSUME_ES5? $jscomp.ISOLATE_POLYFILLS? $jscomp.INSTRUMENT_ASYNC_CONTEXT
l??? of ?(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/collect/ImmutableSet;? goog
???M? com/google/javascript/rhino/IR 6(Ljava/lang/String;)Lcom/google/javascript/rhino/Node;? define
???? getprop X(Lcom/google/javascript/rhino/Node;Ljava/lang/String;)Lcom/google/javascript/rhino/Node;? JSC_UNKNOWN_DEFINE_WARNING? unknown @define variable {0}
????? +com/google/javascript/jscomp/DiagnosticType warning S(Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/jscomp/DiagnosticType;? JSC_INVALID_DEFINE_NAME_ERROR? '"{0}" is not a valid JS identifier name
???? error? %JSC_INVALID_MISSING_DEFINE_ANNOTATION? Missing @define annotation? JSC_INVALID_DEFINE_TYPE? (@define tag only permits primitive types? JSC_INVALID_DEFINE_VALUE? ,invalid initialization value for @define {0}? JSC_INVALID_DEFINE_LOCATION? O@define must be initalized on a static qualified name in global or module scope? JSC_NON_CONST_DEFINE? (@define {0} has already been set at {1}.? JSC_CLOSURE_DEFINES_ERROR? "Invalid CLOSURE_DEFINES definition? JSC_CLOSURE_DEFINES_MULTIPLE? CMultiple CLOSURE_DEFINES definitions for {0}. First occurrence: {1}? $JSC_NON_GLOBAL_CLOSURE_DEFINES_ERROR?