Skip to content

Commit 04d01fb

Browse files
lauraharkercopybara-github
authored andcommitted
Internal change
PiperOrigin-RevId: 621869826
1 parent 042945f commit 04d01fb

File tree

3 files changed

+3
-34
lines changed

3 files changed

+3
-34
lines changed

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

+3-15
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import com.google.javascript.jscomp.deps.ModuleLoader.ResolutionMode;
4242
import com.google.javascript.jscomp.parsing.Config;
4343
import com.google.javascript.jscomp.parsing.parser.FeatureSet;
44-
import com.google.javascript.jscomp.resources.ResourceLoader;
4544
import com.google.javascript.rhino.IR;
4645
import com.google.javascript.rhino.Node;
4746
import com.google.javascript.rhino.SourcePosition;
@@ -1126,15 +1125,8 @@ public boolean getAssumeStaticInheritanceIsNotUsed() {
11261125

11271126
private String productionInstrumentationArrayName;
11281127

1129-
private static final ImmutableList<ConformanceConfig> GLOBAL_CONFORMANCE_CONFIGS =
1130-
ImmutableList.of(ResourceLoader.loadGlobalConformance(CompilerOptions.class));
1131-
1132-
/**
1133-
* List of conformance configs to use in CheckConformance.
1134-
*
1135-
* <p>The first entry of this list is always the Global ConformanceConfig
1136-
*/
1137-
private ImmutableList<ConformanceConfig> conformanceConfigs = GLOBAL_CONFORMANCE_CONFIGS;
1128+
/** List of conformance configs to use in CheckConformance. */
1129+
private ImmutableList<ConformanceConfig> conformanceConfigs = ImmutableList.of();
11381130

11391131
/**
11401132
* Remove the first match of this regex from any paths when checking conformance whitelists.
@@ -2667,11 +2659,7 @@ public void setConformanceConfig(ConformanceConfig conformanceConfig) {
26672659
/** Both enable and configure conformance checks, if non-null. */
26682660
@GwtIncompatible("Conformance")
26692661
public void setConformanceConfigs(List<ConformanceConfig> configs) {
2670-
this.conformanceConfigs =
2671-
ImmutableList.<ConformanceConfig>builder()
2672-
.add(ResourceLoader.loadGlobalConformance(CompilerOptions.class))
2673-
.addAll(configs)
2674-
.build();
2662+
this.conformanceConfigs = ImmutableList.copyOf(configs);
26752663
}
26762664

26772665
public void clearConformanceConfigs() {

src/com/google/javascript/jscomp/resources/ResourceLoader.java

-14
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.google.common.annotations.GwtIncompatible;
2222
import com.google.common.collect.ImmutableMap;
2323
import com.google.common.io.CharStreams;
24-
import com.google.javascript.jscomp.ConformanceConfig;
2524
import java.io.IOException;
2625
import java.io.InputStreamReader;
2726

@@ -48,19 +47,6 @@ public static ImmutableMap<String, String> loadPropertiesMap(
4847
return PropertiesParser.parse(loadTextResource(clazz, resourceName));
4948
}
5049

51-
/** Load the global ConformanceConfig */
52-
public static ConformanceConfig loadGlobalConformance(Class<?> clazz) {
53-
ConformanceConfig.Builder builder = ConformanceConfig.newBuilder();
54-
if (resourceExists(clazz, "global_conformance.binarypb")) {
55-
try {
56-
builder.mergeFrom(clazz.getResourceAsStream("global_conformance.binarypb"));
57-
} catch (IOException e) {
58-
throw new RuntimeException(e);
59-
}
60-
}
61-
return builder.build();
62-
}
63-
6450
public static boolean resourceExists(Class<?> clazz, String path) {
6551
return clazz.getResource(path) != null;
6652
}

src/com/google/javascript/jscomp/resources/super/com/google/javascript/jscomp/resources/ResourceLoader.java

-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package com.google.javascript.jscomp.resources;
1818

1919
import com.google.common.collect.ImmutableMap;
20-
import com.google.javascript.jscomp.ConformanceConfig;
2120
import jsinterop.annotations.JsType;
2221
import jsinterop.base.JsPropertyMap;
2322

@@ -41,10 +40,6 @@ public static ImmutableMap<String, String> loadPropertiesMap(String resourceName
4140
return PropertiesParser.parse(loadTextResource(null, resourceName));
4241
}
4342

44-
public static ConformanceConfig loadGlobalConformance(Class<?> clazz) {
45-
return ConformanceConfig.newBuilder().build();
46-
}
47-
4843
public static boolean resourceExists(Class<?> clazz, String path) {
4944
// TODO(sdh): this is supposed to be relative to the given class, but
5045
// GWT can't handle that - probably better to remove the class argument

0 commit comments

Comments
 (0)