Skip to content

Commit d1a474a

Browse files
lauraharkercopybara-github
authored andcommitted
Delete CompilerTestCase.setExpectedSymbolTableError
PiperOrigin-RevId: 845312906
1 parent 1cfe107 commit d1a474a

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

test/com/google/javascript/jscomp/CompilerTestCase.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@
1818

1919
import static com.google.common.base.Preconditions.checkState;
2020
import static com.google.common.collect.ImmutableList.toImmutableList;
21-
import static com.google.common.collect.Iterables.getOnlyElement;
2221
import static com.google.common.truth.Truth.assertThat;
2322
import static com.google.common.truth.Truth.assertWithMessage;
24-
import static com.google.javascript.jscomp.testing.JSErrorSubject.assertError;
2523
import static com.google.javascript.rhino.testing.NodeSubject.assertNode;
2624
import static java.util.Arrays.stream;
2725
import static java.util.stream.Collectors.joining;
@@ -176,9 +174,6 @@ public abstract class CompilerTestCase {
176174
/** Whether we expect parse warnings in the current test. */
177175
private boolean expectParseWarningsInThisTest;
178176

179-
/** An expected symbol table error. Only useful for testing the symbol table error-handling. */
180-
private @Nullable DiagnosticType expectedSymbolTableError;
181-
182177
/** Whether the PureFunctionIdentifier pass runs before the pass being tested */
183178
private boolean computeSideEffects;
184179

@@ -315,7 +310,6 @@ public void setUp() throws Exception {
315310
this.computeSideEffects = false;
316311
this.annotateSourceInfo = false;
317312
this.expectParseWarningsInThisTest = false;
318-
this.expectedSymbolTableError = null;
319313
this.gatherExternPropertiesEnabled = false;
320314
this.inferConsts = false;
321315
this.languageOut = LanguageMode.NO_TRANSPILE;
@@ -1458,18 +1452,6 @@ private void validateWarnings(
14581452
ErrorManager[] errorManagers,
14591453
List<JSError> aggregateWarnings,
14601454
int numRepetitions) {
1461-
// Verify the symbol table.
1462-
// TODO: lharker - why is this necessary?
1463-
ErrorManager symbolTableErrorManager = new BlackHoleErrorManager();
1464-
compiler.setErrorManager(symbolTableErrorManager);
1465-
1466-
ImmutableList<JSError> stErrors = symbolTableErrorManager.getErrors();
1467-
if (expectedSymbolTableError != null) {
1468-
assertError(getOnlyElement(stErrors)).hasType(expectedSymbolTableError);
1469-
} else {
1470-
assertWithMessage("symbol table errors").that(stErrors).isEmpty();
1471-
}
1472-
14731455
LightweightMessageFormatter formatter = new LightweightMessageFormatter(compiler);
14741456
if (expectedWarnings.isEmpty()) {
14751457
assertWithMessage(
@@ -1792,10 +1774,6 @@ protected Compiler createCompiler() {
17921774
return compiler;
17931775
}
17941776

1795-
protected void setExpectedSymbolTableError(DiagnosticType type) {
1796-
this.expectedSymbolTableError = type;
1797-
}
1798-
17991777
/** Finds the first matching qualified name node in post-traversal order. */
18001778
protected final Node findQualifiedNameNode(final String name, Node root) {
18011779
return findQualifiedNameNodes(name, root).get(0);

0 commit comments

Comments
 (0)