Skip to content

Commit 645cc43

Browse files
authored
Move File.separatorChar to File.separator to fix GWT issue
1 parent bbb67d5 commit 645cc43

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/com/google/javascript/jscomp/SourceFile.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,13 @@ public static List<SourceFile> fromZipFile(String zipName, Charset inputCharset)
359359
private static final String JAR_URL_PREFIX = "jar:file:";
360360

361361
private static boolean isZipEntry(String path) {
362-
return path.contains(".zip!" + File.separatorChar) && (path.endsWith(".js") || path.endsWith(".js.map"));
362+
return path.contains(".zip!" + File.separator) && (path.endsWith(".js") || path.endsWith(".js.map"));
363363
}
364364

365365
@GwtIncompatible("java.io.File")
366366
private static SourceFile fromZipEntry(String zipURL, Charset inputCharset) {
367367
checkArgument(isZipEntry(zipURL));
368-
String[] components = zipURL.split(Pattern.quote(BANG_SLASH.replace('/', File.separatorChar)));
368+
String[] components = zipURL.split(Pattern.quote(BANG_SLASH.replace("/", File.separator)));
369369
try {
370370
String zipPath = components[0];
371371
String relativePath = components[1];
@@ -379,7 +379,7 @@ private static SourceFile fromZipEntry(String zipURL, Charset inputCharset) {
379379
public static SourceFile fromZipEntry(
380380
String originalZipPath, String absoluteZipPath, String entryPath, Charset inputCharset)
381381
throws MalformedURLException {
382-
String zipEntryPath = JAR_URL_PREFIX + absoluteZipPath + BANG_SLASH + entryPath.replace(File.pathSeparatorChar, '/');
382+
String zipEntryPath = JAR_URL_PREFIX + absoluteZipPath + BANG_SLASH + entryPath.replace(File.pathSeparator, "/");
383383
URL zipEntryUrl = new URL(zipEntryPath);
384384

385385
return builder()

0 commit comments

Comments
 (0)