Skip to content

Commit

Permalink
Use immutable interface for return types when the actual values returned
Browse files Browse the repository at this point in the history
are of an immutable collection.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176038754
  • Loading branch information
blickly authored and Tyler Breisacher committed Nov 17, 2017
1 parent 146316b commit 55e9f07
Show file tree
Hide file tree
Showing 25 changed files with 55 additions and 60 deletions.
Expand Up @@ -578,11 +578,11 @@ protected List<SourceFile> createInputs(
} }


/** /**
* Check that relative paths inside zip files are unique, since multiple files * Check that relative paths inside zip files are unique, since multiple files with the same path
* with the same path inside different zips are considered duplicate inputs. * inside different zips are considered duplicate inputs. Parameter {@code sourceFiles} may be
* Parameter {@code sourceFiles} may be modified if duplicates are removed. * modified if duplicates are removed.
*/ */
public static List<JSError> removeDuplicateZipEntries( public static ImmutableList<JSError> removeDuplicateZipEntries(
List<SourceFile> sourceFiles, List<JsModuleSpec> jsModuleSpecs) throws IOException { List<SourceFile> sourceFiles, List<JsModuleSpec> jsModuleSpecs) throws IOException {
ImmutableList.Builder<JSError> errors = ImmutableList.builder(); ImmutableList.Builder<JSError> errors = ImmutableList.builder();
Map<String, SourceFile> sourceFilesByName = new HashMap<>(); Map<String, SourceFile> sourceFilesByName = new HashMap<>();
Expand Down
Expand Up @@ -140,7 +140,7 @@ private static boolean isClassOrConstantName(String name) {


// Return the shortest prefix of the className that refers to a class, // Return the shortest prefix of the className that refers to a class,
// or null if no part refers to a class. // or null if no part refers to a class.
private static List<String> getClassNames(String qualifiedName) { private static ImmutableList<String> getClassNames(String qualifiedName) {
ImmutableList.Builder<String> classNames = ImmutableList.builder(); ImmutableList.Builder<String> classNames = ImmutableList.builder();
List<String> parts = DOT_SPLITTER.splitToList(qualifiedName); List<String> parts = DOT_SPLITTER.splitToList(qualifiedName);
for (int i = 0; i < parts.size(); i++) { for (int i = 0; i < parts.size(); i++) {
Expand Down
6 changes: 3 additions & 3 deletions src/com/google/javascript/jscomp/ChromeCodingConvention.java
Expand Up @@ -15,14 +15,14 @@
*/ */
package com.google.javascript.jscomp; package com.google.javascript.jscomp;


import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.errorprone.annotations.Immutable; import com.google.errorprone.annotations.Immutable;
import com.google.javascript.jscomp.ClosureCodingConvention.AssertInstanceofSpec; import com.google.javascript.jscomp.ClosureCodingConvention.AssertInstanceofSpec;
import com.google.javascript.rhino.FunctionTypeI; import com.google.javascript.rhino.FunctionTypeI;
import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.NominalTypeBuilder; import com.google.javascript.rhino.NominalTypeBuilder;
import java.util.Collection;


/** /**
* Coding convention used by the Chrome team to compile Chrome's JS. * Coding convention used by the Chrome team to compile Chrome's JS.
Expand Down Expand Up @@ -60,12 +60,12 @@ public void applySingletonGetter(NominalTypeBuilder classType, FunctionTypeI get
} }


@Override @Override
public Collection<String> getIndirectlyDeclaredProperties() { public ImmutableCollection<String> getIndirectlyDeclaredProperties() {
return indirectlyDeclaredProperties; return indirectlyDeclaredProperties;
} }


@Override @Override
public Collection<AssertionFunctionSpec> getAssertionFunctions() { public ImmutableCollection<AssertionFunctionSpec> getAssertionFunctions() {
return ImmutableList.of( return ImmutableList.of(
new AssertionFunctionSpec("assert"), new AssertionFunctionSpec("assert"),
new AssertInstanceofSpec("cr.ui.decorate") new AssertInstanceofSpec("cr.ui.decorate")
Expand Down
6 changes: 3 additions & 3 deletions src/com/google/javascript/jscomp/ClosureCodingConvention.java
Expand Up @@ -19,6 +19,7 @@
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;


import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.errorprone.annotations.Immutable; import com.google.errorprone.annotations.Immutable;
Expand All @@ -33,7 +34,6 @@
import com.google.javascript.rhino.jstype.JSTypeNative; import com.google.javascript.rhino.jstype.JSTypeNative;
import com.google.javascript.rhino.jstype.JSTypeRegistry; import com.google.javascript.rhino.jstype.JSTypeRegistry;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.List; import java.util.List;


/** /**
Expand Down Expand Up @@ -388,7 +388,7 @@ public boolean isPrivate(String name) {
} }


@Override @Override
public Collection<AssertionFunctionSpec> getAssertionFunctions() { public ImmutableCollection<AssertionFunctionSpec> getAssertionFunctions() {
return ImmutableList.of( return ImmutableList.of(
new AssertionFunctionSpec("goog.asserts.assert", JSTypeNative.TRUTHY), new AssertionFunctionSpec("goog.asserts.assert", JSTypeNative.TRUTHY),
new AssertionFunctionSpec("goog.asserts.assertNumber", JSTypeNative.NUMBER_TYPE), new AssertionFunctionSpec("goog.asserts.assertNumber", JSTypeNative.NUMBER_TYPE),
Expand Down Expand Up @@ -471,7 +471,7 @@ private boolean matchesCacheMethodName(Node target) {
} }


@Override @Override
public Collection<String> getIndirectlyDeclaredProperties() { public ImmutableCollection<String> getIndirectlyDeclaredProperties() {
return indirectlyDeclaredProperties; return indirectlyDeclaredProperties;
} }


Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/CodePrinter.java
Expand Up @@ -227,7 +227,7 @@ protected final int getCurrentLineIndex() {
} }


/** Calculates length of each line in compiled code. */ /** Calculates length of each line in compiled code. */
private static List<Integer> computeLineLengths(String code) { private static ImmutableList<Integer> computeLineLengths(String code) {
ImmutableList.Builder<Integer> builder = ImmutableList.<Integer>builder(); ImmutableList.Builder<Integer> builder = ImmutableList.<Integer>builder();
int lineStartPos = 0; int lineStartPos = 0;
int lineEndPos = code.indexOf('\n'); int lineEndPos = code.indexOf('\n');
Expand Down
3 changes: 2 additions & 1 deletion src/com/google/javascript/jscomp/ConformanceRules.java
Expand Up @@ -23,6 +23,7 @@
import com.google.common.base.Ascii; import com.google.common.base.Ascii;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
Expand Down Expand Up @@ -1628,7 +1629,7 @@ protected ConformanceResult checkConformance(NodeTraversal t, Node n) {
return ConformanceResult.CONFORMANCE; return ConformanceResult.CONFORMANCE;
} }


private Collection<String> getTagNames(Node tag) { private ImmutableCollection<String> getTagNames(Node tag) {
if (tag.isString()) { if (tag.isString()) {
return ImmutableSet.of(tag.getString().toLowerCase()); return ImmutableSet.of(tag.getString().toLowerCase());
} else if (tag.isGetProp() && tag.getFirstChild().matchesQualifiedName("goog.dom.TagName")) { } else if (tag.isGetProp() && tag.getFirstChild().matchesQualifiedName("goog.dom.TagName")) {
Expand Down
5 changes: 3 additions & 2 deletions src/com/google/javascript/jscomp/GlobalTypeInfoCollector.java
Expand Up @@ -22,6 +22,7 @@


import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.google.common.collect.HashBasedTable; import com.google.common.collect.HashBasedTable;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.collect.LinkedHashMultimap; import com.google.common.collect.LinkedHashMultimap;
Expand Down Expand Up @@ -523,8 +524,8 @@ private void defineObjectAndFunctionIfMissing() {
} }
} }


private Collection<PropertyDef> getPropDefsFromInterface(NominalType nominalType, private ImmutableCollection<PropertyDef> getPropDefsFromInterface(
String pname) { NominalType nominalType, String pname) {
checkArgument(nominalType.isFrozen()); checkArgument(nominalType.isFrozen());
checkArgument(nominalType.isInterface() || nominalType.isBuiltinObject()); checkArgument(nominalType.isInterface() || nominalType.isBuiltinObject());
if (nominalType.getPropDeclaredType(pname) == null) { if (nominalType.getPropDeclaredType(pname) == null) {
Expand Down
6 changes: 3 additions & 3 deletions src/com/google/javascript/jscomp/NTIScope.java
Expand Up @@ -377,7 +377,7 @@ Set<String> getOuterVars() {
return new LinkedHashSet<>(outerVars); return new LinkedHashSet<>(outerVars);
} }


Set<String> getLocalFunDefs() { ImmutableSet<String> getLocalFunDefs() {
return ImmutableSet.copyOf(localFunDefs.keySet()); return ImmutableSet.copyOf(localFunDefs.keySet());
} }


Expand Down Expand Up @@ -490,11 +490,11 @@ NTIScope getScope(String fnName) {
return s; return s;
} }


Set<String> getLocals() { ImmutableSet<String> getLocals() {
return ImmutableSet.copyOf(locals.keySet()); return ImmutableSet.copyOf(locals.keySet());
} }


Set<String> getExterns() { ImmutableSet<String> getExterns() {
return ImmutableSet.copyOf(externs.keySet()); return ImmutableSet.copyOf(externs.keySet());
} }


Expand Down
4 changes: 2 additions & 2 deletions src/com/google/javascript/jscomp/PolymerPass.java
Expand Up @@ -22,6 +22,7 @@
import static com.google.javascript.jscomp.PolymerPassErrors.POLYMER_MISSING_EXTERNS; import static com.google.javascript.jscomp.PolymerPassErrors.POLYMER_MISSING_EXTERNS;


import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback; import com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback;
import com.google.javascript.rhino.IR; import com.google.javascript.rhino.IR;
import com.google.javascript.rhino.JSDocInfo; import com.google.javascript.rhino.JSDocInfo;
Expand All @@ -30,7 +31,6 @@
import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.Token; import com.google.javascript.rhino.Token;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map;
import java.util.Set; import java.util.Set;


/** /**
Expand All @@ -48,7 +48,7 @@ final class PolymerPass extends AbstractPostOrderCallback implements HotSwapComp
static final String VIRTUAL_FILE = "<PolymerPass.java>"; static final String VIRTUAL_FILE = "<PolymerPass.java>";


private final AbstractCompiler compiler; private final AbstractCompiler compiler;
private final Map<String, String> tagNameMap; private final ImmutableMap<String, String> tagNameMap;
private final int polymerVersion; private final int polymerVersion;
private final boolean propertyRenamingEnabled; private final boolean propertyRenamingEnabled;


Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/SymbolTable.java
Expand Up @@ -147,7 +147,7 @@ public Iterable<Reference> getReferences(Symbol symbol) {
return Collections.unmodifiableCollection(symbol.references.values()); return Collections.unmodifiableCollection(symbol.references.values());
} }


public List<Reference> getReferenceList(Symbol symbol) { public ImmutableList<Reference> getReferenceList(Symbol symbol) {
return ImmutableList.copyOf(symbol.references.values()); return ImmutableList.copyOf(symbol.references.values());
} }


Expand Down
4 changes: 1 addition & 3 deletions src/com/google/javascript/jscomp/TagNameToType.java
Expand Up @@ -17,13 +17,11 @@


import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;


import java.util.Map;

/** /**
* Contains a mapping from HTML Element tag name to the javascript type of that element at runtime. * Contains a mapping from HTML Element tag name to the javascript type of that element at runtime.
*/ */
class TagNameToType { class TagNameToType {
static Map<String, String> getMap() { static ImmutableMap<String, String> getMap() {
return new ImmutableMap.Builder<String, String>() return new ImmutableMap.Builder<String, String>()
.put("a", "HTMLAnchorElement") .put("a", "HTMLAnchorElement")
.put("area", "HTMLAreaElement") .put("area", "HTMLAreaElement")
Expand Down
Expand Up @@ -68,7 +68,7 @@ public Es6SortedDependencies(List<INPUT> userOrderedInputs) {
} }


@Override @Override
public List<INPUT> getDependenciesOf(List<INPUT> rootInputs, boolean sorted) { public ImmutableList<INPUT> getDependenciesOf(List<INPUT> rootInputs, boolean sorted) {
checkArgument(userOrderedInputs.containsAll(rootInputs)); checkArgument(userOrderedInputs.containsAll(rootInputs));


Set<INPUT> includedInputs = new HashSet<>(); Set<INPUT> includedInputs = new HashSet<>();
Expand Down Expand Up @@ -105,7 +105,7 @@ public INPUT getInputProviding(String symbolName) throws MissingProvideException
} }


@Override @Override
public List<INPUT> getInputsWithoutProvides() { public ImmutableList<INPUT> getInputsWithoutProvides() {
return ImmutableList.copyOf(nonExportingInputs.values()); return ImmutableList.copyOf(nonExportingInputs.values());
} }


Expand Down
Expand Up @@ -92,7 +92,7 @@ public ImmutableMap<String, String> getLoadFlags() {
return loadFlags; return loadFlags;
} }


private static Map<String, String> loadFlags(boolean isModule) { private static ImmutableMap<String, String> loadFlags(boolean isModule) {
return isModule ? ImmutableMap.of("module", "goog") : ImmutableMap.<String, String>of(); return isModule ? ImmutableMap.of("module", "goog") : ImmutableMap.<String, String>of();
} }


Expand Down
8 changes: 3 additions & 5 deletions src/com/google/javascript/jscomp/gwt/client/GwtRunner.java
Expand Up @@ -189,10 +189,8 @@ private static native String[] getStringArray(Flags flags, String key) /*-{
private static final class JsMap extends JavaScriptObject { private static final class JsMap extends JavaScriptObject {
protected JsMap() {} protected JsMap() {}


/** /** @return This {@code JsMap} as a {@link Map}. */
* @return This {@code JsMap} as a {@link Map}. ImmutableMap<String, Object> asMap() {
*/
Map<String, Object> asMap() {
ImmutableMap.Builder<String, Object> builder = new ImmutableMap.Builder<>(); ImmutableMap.Builder<String, Object> builder = new ImmutableMap.Builder<>();
for (String key : keys(this)) { for (String key : keys(this)) {
builder.put(key, get(key)); builder.put(key, get(key));
Expand Down Expand Up @@ -285,7 +283,7 @@ private static List<SourceFile> createExterns(CompilerOptions.Environment enviro
return DefaultExterns.prepareExterns(environment, all); return DefaultExterns.prepareExterns(environment, all);
} }


private static List<ModuleIdentifier> createEntryPoints(String[] entryPoints) { private static ImmutableList<ModuleIdentifier> createEntryPoints(String[] entryPoints) {
ImmutableList.Builder<ModuleIdentifier> builder = new ImmutableList.Builder<>(); ImmutableList.Builder<ModuleIdentifier> builder = new ImmutableList.Builder<>();
for (String entryPoint : entryPoints) { for (String entryPoint : entryPoints) {
if (entryPoint.startsWith("goog:")) { if (entryPoint.startsWith("goog:")) {
Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/parsing/ParserRunner.java
Expand Up @@ -107,7 +107,7 @@ private static synchronized void initResourceConfig() {
reservedVars = extractList(config.getString("compiler.reserved.vars")); reservedVars = extractList(config.getString("compiler.reserved.vars"));
} }


private static Set<String> extractList(String configProp) { private static ImmutableSet<String> extractList(String configProp) {
return ImmutableSet.copyOf(Splitter.on(',').trimResults().split(configProp)); return ImmutableSet.copyOf(Splitter.on(',').trimResults().split(configProp));
} }


Expand Down
12 changes: 6 additions & 6 deletions src/com/google/javascript/jscomp/regex/RegExpTree.java
Expand Up @@ -590,7 +590,7 @@ public final int numCapturingGroups() {
} }


@Override @Override
public final List<? extends RegExpTree> children() { public final ImmutableList<? extends RegExpTree> children() {
return ImmutableList.of(); return ImmutableList.of();
} }
} }
Expand Down Expand Up @@ -870,7 +870,7 @@ public int numCapturingGroups() {
} }


@Override @Override
public List<? extends RegExpTree> children() { public ImmutableList<? extends RegExpTree> children() {
return ImmutableList.of(body); return ImmutableList.of(body);
} }


Expand Down Expand Up @@ -1118,7 +1118,7 @@ public int numCapturingGroups() {
} }


@Override @Override
public List<? extends RegExpTree> children() { public ImmutableList<? extends RegExpTree> children() {
return alternatives; return alternatives;
} }


Expand Down Expand Up @@ -1189,7 +1189,7 @@ public int numCapturingGroups() {
} }


@Override @Override
public List<? extends RegExpTree> children() { public ImmutableList<? extends RegExpTree> children() {
return ImmutableList.of(body); return ImmutableList.of(body);
} }


Expand Down Expand Up @@ -1246,7 +1246,7 @@ public int numCapturingGroups() {
} }


@Override @Override
public List<? extends RegExpTree> children() { public ImmutableList<? extends RegExpTree> children() {
return ImmutableList.of(body); return ImmutableList.of(body);
} }


Expand Down Expand Up @@ -1746,7 +1746,7 @@ public int numCapturingGroups() {
} }


@Override @Override
public List<? extends RegExpTree> children() { public ImmutableList<? extends RegExpTree> children() {
return elements; return elements;
} }


Expand Down
11 changes: 5 additions & 6 deletions src/com/google/javascript/refactoring/ApplySuggestedFixes.java
Expand Up @@ -84,13 +84,12 @@ public static void applySuggestedFixesToFiles(Iterable<SuggestedFix> fixes)
} }


/** /**
* Applies the provided set of suggested fixes to the provided code and returns the new code. * Applies the provided set of suggested fixes to the provided code and returns the new code. The
* The {@code filenameToCodeMap} must contain all the files that the provided fixes apply to. * {@code filenameToCodeMap} must contain all the files that the provided fixes apply to. The
* The fixes can be provided in any order, but they may not have any overlapping modifications * fixes can be provided in any order, but they may not have any overlapping modifications for the
* for the same file. * same file. This function will return new code only for the files that have been modified.
* This function will return new code only for the files that have been modified.
*/ */
public static Map<String, String> applySuggestedFixesToCode( public static ImmutableMap<String, String> applySuggestedFixesToCode(
Iterable<SuggestedFix> fixes, Map<String, String> filenameToCodeMap) { Iterable<SuggestedFix> fixes, Map<String, String> filenameToCodeMap) {
ReplacementMap map = new ReplacementMap(); ReplacementMap map = new ReplacementMap();
for (SuggestedFix fix : fixes) { for (SuggestedFix fix : fixes) {
Expand Down
Expand Up @@ -224,7 +224,7 @@ private static SuggestedFix getFixForReferenceToShortImportByLongName(
.build(); .build();
} }


private static List<SuggestedFix> getFixesForImplicitlyNullableJsDoc( private static ImmutableList<SuggestedFix> getFixesForImplicitlyNullableJsDoc(
JSError error, AbstractCompiler compiler) { JSError error, AbstractCompiler compiler) {
SuggestedFix qmark = SuggestedFix qmark =
new SuggestedFix.Builder() new SuggestedFix.Builder()
Expand Down
4 changes: 2 additions & 2 deletions src/com/google/javascript/refactoring/RefasterJsScanner.java
Expand Up @@ -130,7 +130,7 @@ public void clearTemplates() {
} }


@Override @Override
public List<SuggestedFix> processMatch(Match match) { public ImmutableList<SuggestedFix> processMatch(Match match) {
SuggestedFix.Builder fix = new SuggestedFix.Builder(); SuggestedFix.Builder fix = new SuggestedFix.Builder();
// Only replace the original source with a version serialized from the AST if the after template // Only replace the original source with a version serialized from the AST if the after template
// is actually different. Otherwise, we might just add churn (e.g. single quotes into double // is actually different. Otherwise, we might just add churn (e.g. single quotes into double
Expand Down Expand Up @@ -325,7 +325,7 @@ List<String> getGoogRequiresToRemove() {
return getGoogRequiresFromPattern(REMOVE_GOOG_REQUIRE_PATTERN); return getGoogRequiresFromPattern(REMOVE_GOOG_REQUIRE_PATTERN);
} }


private List<String> getGoogRequiresFromPattern(Pattern pattern) { private ImmutableList<String> getGoogRequiresFromPattern(Pattern pattern) {
JSDocInfo jsDoc = NodeUtil.getBestJSDocInfo(beforeTemplate); JSDocInfo jsDoc = NodeUtil.getBestJSDocInfo(beforeTemplate);
if (jsDoc == null) { if (jsDoc == null) {
return ImmutableList.of(); return ImmutableList.of();
Expand Down
Expand Up @@ -22,7 +22,6 @@
import com.google.javascript.refactoring.Scanner; import com.google.javascript.refactoring.Scanner;
import com.google.javascript.refactoring.SuggestedFix; import com.google.javascript.refactoring.SuggestedFix;
import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Node;
import java.util.List;


/** /**
* Replaces goog.bind(..., this) with arrow functions. The pretty-printer does not do well with * Replaces goog.bind(..., this) with arrow functions. The pretty-printer does not do well with
Expand Down Expand Up @@ -58,7 +57,7 @@ public boolean matches(Node node, NodeMetadata metadata) {
} }


@Override @Override
public List<SuggestedFix> processMatch(Match match) { public ImmutableList<SuggestedFix> processMatch(Match match) {
AbstractCompiler compiler = match.getMetadata().getCompiler(); AbstractCompiler compiler = match.getMetadata().getCompiler();
Node googBindCall = match.getNode(); Node googBindCall = match.getNode();
Node function = googBindCall.getFirstChild().getNext(); Node function = googBindCall.getFirstChild().getNext();
Expand Down
2 changes: 1 addition & 1 deletion test/com/google/javascript/jscomp/CompilerTestCase.java
Expand Up @@ -1201,7 +1201,7 @@ protected void testInternal(
testInternal(compiler, inputs, expected, diagnostic, postconditions); testInternal(compiler, inputs, expected, diagnostic, postconditions);
} }


private static List<SourceFile> maybeCreateSources(String name, String srcText) { private static ImmutableList<SourceFile> maybeCreateSources(String name, String srcText) {
if (srcText != null) { if (srcText != null) {
return ImmutableList.of(SourceFile.fromCode(name, srcText)); return ImmutableList.of(SourceFile.fromCode(name, srcText));
} }
Expand Down
2 changes: 1 addition & 1 deletion test/com/google/javascript/jscomp/GoldenFileComparer.java
Expand Up @@ -36,7 +36,7 @@ public class GoldenFileComparer {
"test/" "test/"
+ "com/google/javascript/jscomp/testdata/"; + "com/google/javascript/jscomp/testdata/";


private static List<SourceFile> coverageExterns() { private static ImmutableList<SourceFile> coverageExterns() {
SourceFile externs = SourceFile.fromCode( SourceFile externs = SourceFile.fromCode(
"externs", "function Symbol() {}; var window; var self;"); "externs", "function Symbol() {}; var window; var self;");
return ImmutableList.of(externs); return ImmutableList.of(externs);
Expand Down

0 comments on commit 55e9f07

Please sign in to comment.