|
18 | 18 |
|
19 | 19 | import static com.google.common.base.Preconditions.checkState; |
20 | 20 | import static com.google.common.collect.ImmutableList.toImmutableList; |
21 | | -import static com.google.common.collect.Iterables.getOnlyElement; |
22 | 21 | import static com.google.common.truth.Truth.assertThat; |
23 | 22 | import static com.google.common.truth.Truth.assertWithMessage; |
24 | | -import static com.google.javascript.jscomp.testing.JSErrorSubject.assertError; |
25 | 23 | import static com.google.javascript.rhino.testing.NodeSubject.assertNode; |
26 | 24 | import static java.util.Arrays.stream; |
27 | 25 | import static java.util.stream.Collectors.joining; |
@@ -176,9 +174,6 @@ public abstract class CompilerTestCase { |
176 | 174 | /** Whether we expect parse warnings in the current test. */ |
177 | 175 | private boolean expectParseWarningsInThisTest; |
178 | 176 |
|
179 | | - /** An expected symbol table error. Only useful for testing the symbol table error-handling. */ |
180 | | - private @Nullable DiagnosticType expectedSymbolTableError; |
181 | | - |
182 | 177 | /** Whether the PureFunctionIdentifier pass runs before the pass being tested */ |
183 | 178 | private boolean computeSideEffects; |
184 | 179 |
|
@@ -315,7 +310,6 @@ public void setUp() throws Exception { |
315 | 310 | this.computeSideEffects = false; |
316 | 311 | this.annotateSourceInfo = false; |
317 | 312 | this.expectParseWarningsInThisTest = false; |
318 | | - this.expectedSymbolTableError = null; |
319 | 313 | this.gatherExternPropertiesEnabled = false; |
320 | 314 | this.inferConsts = false; |
321 | 315 | this.languageOut = LanguageMode.NO_TRANSPILE; |
@@ -1458,18 +1452,6 @@ private void validateWarnings( |
1458 | 1452 | ErrorManager[] errorManagers, |
1459 | 1453 | List<JSError> aggregateWarnings, |
1460 | 1454 | 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 | | - |
1473 | 1455 | LightweightMessageFormatter formatter = new LightweightMessageFormatter(compiler); |
1474 | 1456 | if (expectedWarnings.isEmpty()) { |
1475 | 1457 | assertWithMessage( |
@@ -1792,10 +1774,6 @@ protected Compiler createCompiler() { |
1792 | 1774 | return compiler; |
1793 | 1775 | } |
1794 | 1776 |
|
1795 | | - protected void setExpectedSymbolTableError(DiagnosticType type) { |
1796 | | - this.expectedSymbolTableError = type; |
1797 | | - } |
1798 | | - |
1799 | 1777 | /** Finds the first matching qualified name node in post-traversal order. */ |
1800 | 1778 | protected final Node findQualifiedNameNode(final String name, Node root) { |
1801 | 1779 | return findQualifiedNameNodes(name, root).get(0); |
|
0 commit comments