com.google.javascript.jscomp.SourceFile.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!
???? 74
java/lang/Object ()V
'com/google/javascript/jscomp/SourceFile lineOffsets [I code Ljava/lang/String; numLines I numBytes isClosureUnawareCode Z
! com/google/common/base/Strings
isNullOrEmpty (Ljava/lang/String;)Z # "java/lang/IllegalArgumentException % a source must have a name
" ' ( (Ljava/lang/String;)V * /
, - . / 0 %com/google/javascript/jscomp/Platform getFileSeperator ()Ljava/lang/String;
2 3 4 5 6 java/lang/String equals (Ljava/lang/Object;)Z
2 8 9 : replace D(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; < = > loader 4Lcom/google/javascript/jscomp/SourceFile$CodeLoader; @ A fileName C D E kind 9Lcom/google/javascript/rhino/StaticSourceFile$SourceKind;
G H findLineOffsets J K L makeConcatWithConstants (II)Ljava/lang/String;
N O 0 getCode Q java/io/IOException S
2 U V W indexOf (II)I
Y Z [ \ ] $com/google/common/base/Preconditions
checkState (Z)V
_ ` a b 0 2com/google/javascript/jscomp/SourceFile$CodeLoader loadUncachedCode
d e ( setCodeAndDoBookkeeping
_ g h i openUncachedReader ()Ljava/io/Reader; k java/io/StringReader
j ' n
2 p q !
startsWith
2 s t u length ()I
2 w x y substring (I)Ljava/lang/String;
{ | 0 getName
~ ? ? ? java/util/Arrays binarySearch ([II)I
? ? ? ? W java/lang/Math min
? ? ? getLineOfOffset (I)I
2 ? x L ? )com/google/javascript/jscomp/SimpleRegion
? ? ? (IILjava/lang/String;)V
2 ? ? ? charAt (I)C
? ? ? W max ? java/io/FileInputStream
? '
? ? ? fromZipInput S(Ljava/lang/String;Ljava/io/InputStream;Ljava/nio/charset/Charset;)Ljava/util/List;
? ? ? ? java/io/InputStream close ? java/lang/Throwable
? ? ? ?
addSuppressed (Ljava/lang/Throwable;)V ? java/io/File
? '
? ? ? 0 getAbsolutePath ? java/util/ArrayList
? ? java/util/zip/ZipInputStream
? ? ? 2(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
? ? ? ? getNextEntry ()Ljava/util/zip/ZipEntry;
? { ? java/util/zip/ZipEntry ? .js
2 ? ? ! endsWith
? ? ? builder 3()Lcom/google/javascript/jscomp/SourceFile$Builder;
? ? ? ? ? /com/google/javascript/jscomp/SourceFile$Builder withCharset M(Ljava/nio/charset/Charset;)Lcom/google/javascript/jscomp/SourceFile$Builder; ? ?
BANG_SLASH ? K ? J(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
? ? ? ? withOriginalPath E(Ljava/lang/String;)Lcom/google/javascript/jscomp/SourceFile$Builder;
? ? ? ? withZipEntryPath W(Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/jscomp/SourceFile$Builder;
? ? ? ? build +()Lcom/google/javascript/jscomp/SourceFile; ? ? ? ? 6 java/util/List add
? ?
? ? ? ? withPath
? ? ? ? G(Ljava/nio/file/Path;)Lcom/google/javascript/jscomp/SourceFile$Builder;
? ? ? ? withKind l(Lcom/google/javascript/rhino/StaticSourceFile$SourceKind;)Lcom/google/javascript/jscomp/SourceFile$Builder;
? ? ? ? withContent
? ? ? ? 0 :com/google/javascript/jscomp/serialization/SourceFileProto getFilename ? #Cannot restore state for %s from %s
Y ? \ ? :(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
?
getSourceKind I()Lcom/google/javascript/jscomp/serialization/SourceFileProto$SourceKind; Ecom/google/javascript/jscomp/serialization/SourceFileProto$SourceKind EXTERN GLcom/google/javascript/jscomp/serialization/SourceFileProto$SourceKind;
getKind ;()Lcom/google/javascript/rhino/StaticSourceFile$SourceKind; E 7com/google/javascript/rhino/StaticSourceFile$SourceKind QTypedAST compilations must pass all extern files as externs, not js, but found %s
Y \ ((ZLjava/lang/String;Ljava/lang/Object;)V
? u getNumLinesPlusOne
? u getNumBytesPlusOne
? getIsClosureUnawareCode ()Z
!"# getSourceKindFromProto w(Lcom/google/javascript/jscomp/serialization/SourceFileProto;)Lcom/google/javascript/rhino/StaticSourceFile$SourceKind;
%&' fromProto ?(Lcom/google/javascript/jscomp/serialization/SourceFileProto;Lcom/google/javascript/rhino/StaticSourceFile$SourceKind;)Lcom/google/javascript/jscomp/SourceFile;
)* markAsClosureUnawareCode ,-./ )com/google/javascript/jscomp/SourceFile$1 P$SwitchMap$com$google$javascript$jscomp$serialization$SourceFileProto$LoaderCase
?123
getLoaderCase I()Lcom/google/javascript/jscomp/serialization/SourceFileProto$LoaderCase;
5678 u Ecom/google/javascript/jscomp/serialization/SourceFileProto$LoaderCase ordinal
?:; 0 getPreloadedContents
=>? fromCode ?(Ljava/lang/String;Ljava/lang/String;Lcom/google/javascript/rhino/StaticSourceFile$SourceKind;)Lcom/google/javascript/jscomp/SourceFile;
?ABC
getFileOnDisk I()Lcom/google/javascript/jscomp/serialization/SourceFileProto$FileOnDisk;
EFGH 0 Ecom/google/javascript/jscomp/serialization/SourceFileProto$FileOnDisk
getActualPath
2JK isEmpty
EMN 0
getCharset
PQR toCharset .(Ljava/lang/String;)Ljava/nio/charset/Charset;
?TUV getZipEntry M()Lcom/google/javascript/jscomp/serialization/SourceFileProto$ZipEntryOnDisk;
XMY Icom/google/javascript/jscomp/serialization/SourceFileProto$ZipEntryOnDisk
X[\ 0
getZipPath
X^_ 0 getEntryNamea java/lang/AssertionError
` ,de P$SwitchMap$com$google$javascript$jscomp$serialization$SourceFileProto$SourceKind
6 hi E STRONG klmno !java/nio/charset/StandardCharsets UTF_8 Ljava/nio/charset/Charset;
qrstR java/nio/charset/Charset forName
?
_wxy toProtoLocationBuilder X(Ljava/lang/String;)Lcom/google/javascript/jscomp/serialization/SourceFileProto$Builder;
{|}~y Bcom/google/javascript/jscomp/serialization/SourceFileProto$Builder setFilename
??? sourceKindToProto ?(Lcom/google/javascript/rhino/StaticSourceFile$SourceKind;)Lcom/google/javascript/jscomp/serialization/SourceFileProto$SourceKind;
{???
setSourceKind ?(Lcom/google/javascript/jscomp/serialization/SourceFileProto$SourceKind;)Lcom/google/javascript/jscomp/serialization/SourceFileProto$Builder;
{??? setIsClosureUnawareCode G(Z)Lcom/google/javascript/jscomp/serialization/SourceFileProto$Builder;
{??? setNumLinesPlusOne G(I)Lcom/google/javascript/jscomp/serialization/SourceFileProto$Builder;
{??? setNumBytesPlusOne
{? ?? >()Lcom/google/javascript/jscomp/serialization/SourceFileProto; ,?? B$SwitchMap$com$google$javascript$rhino$StaticSourceFile$SourceKind
6 ?? CODE ? K? &(Ljava/lang/String;)Ljava/lang/String;? ,com/google/javascript/rhino/StaticSourceFile UTF8_BOM
ConstantValue SOURCE_EXCERPT_REGION_LENGTH RuntimeVisibleTypeAnnotations #Lorg/jspecify/annotations/Nullable; ?(Lcom/google/javascript/jscomp/SourceFile$CodeLoader;Ljava/lang/String;Lcom/google/javascript/rhino/StaticSourceFile$SourceKind;)V Code LineNumberTable LocalVariableTable this )Lcom/google/javascript/jscomp/SourceFile;
StackMapTable MethodParameters
getLineOffset lineno getNumLines e Ljava/io/IOException; getNumBytes localCode offsets index offset
Exceptions setCodeDeprecated
Deprecated RuntimeVisibleAnnotations Ljava/lang/Deprecated;
getCodeReader uncachedReader Ljava/io/Reader; RuntimeInvisibleAnnotations /Lcom/google/common/annotations/GwtIncompatible; value java.io.Reader
sourceCode getOriginalPath ,Lcom/google/errorprone/annotations/InlineMe; replacement this.getName() clearCachedSource hasSourceInMemory setKind <(Lcom/google/javascript/rhino/StaticSourceFile$SourceKind;)V insertionPoint search getColumnOfOffset line getLine js
lineNumber pos getLines )(II)Lcom/google/javascript/jscomp/Region; endChar endLine getRegion ((I)Lcom/google/javascript/jscomp/Region; nextpos n last startLine end toString fromZipFile >(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/util/List; input Ljava/io/InputStream; zipName inputCharset Signature i(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/util/List; entryName zipEntry Ljava/util/zip/ZipEntry; in Ljava/util/zip/ZipInputStream; absoluteZipPath sourceFiles Ljava/util/List; LocalVariableTypeTable ;Ljava/util/List; ~(Ljava/lang/String;Ljava/io/InputStream;Ljava/nio/charset/Charset;)Ljava/util/List; java.util.zip.ZipInputStream fromFile W(Ljava/lang/String;Ljava/nio/charset/Charset;)Lcom/google/javascript/jscomp/SourceFile; charset java.io.File =(Ljava/lang/String;)Lcom/google/javascript/jscomp/SourceFile; fromPath Y(Ljava/nio/file/Path;Ljava/nio/charset/Charset;)Lcom/google/javascript/jscomp/SourceFile; path Ljava/nio/file/Path; O(Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/jscomp/SourceFile; restoreCachedStateFrom ?(Lcom/google/javascript/jscomp/serialization/SourceFileProto;)V protoSourceFile