Skip to content

Commit

Permalink
Inline two methods in TypeICompilerTestCase. We aren't using the save…
Browse files Browse the repository at this point in the history
…d mode anywhere.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171635159
  • Loading branch information
dimvar authored and Tyler Breisacher committed Oct 10, 2017
1 parent f1de2f8 commit 11150b2
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions test/com/google/javascript/jscomp/TypeICompilerTestCase.java
Expand Up @@ -92,10 +92,14 @@ protected void testInternal(
protected void testExternChanges(String extern, String input, String expectedExtern,
DiagnosticType... warnings) {
if (this.mode.runsOTI()) {
testExternChangesOTI(extern, input, expectedExtern, warnings);
enableTypeCheck();
super.testExternChanges(extern, input, expectedExtern, warnings);
disableTypeCheck();
}
if (this.mode.runsNTI()) {
testExternChangesNTI(extern, input, expectedExtern, warnings);
enableNewTypeInference();
super.testExternChanges(extern, input, expectedExtern, warnings);
disableNewTypeInference();
}
if (this.mode.runsNeither()) {
super.testExternChanges(extern, input, expectedExtern, warnings);
Expand Down Expand Up @@ -148,26 +152,6 @@ private void testNTI(
this.mode = saved;
}

private void testExternChangesOTI(String extern, String input, String expectedExtern,
DiagnosticType... warnings) {
TypeInferenceMode saved = this.mode;
this.mode = TypeInferenceMode.OTI_ONLY;
enableTypeCheck();
super.testExternChanges(extern, input, expectedExtern, warnings);
disableTypeCheck();
this.mode = saved;
}

private void testExternChangesNTI(String extern, String input, String expectedExtern,
DiagnosticType... warnings) {
TypeInferenceMode saved = this.mode;
this.mode = TypeInferenceMode.NTI_ONLY;
enableNewTypeInference();
super.testExternChanges(extern, input, expectedExtern, warnings);
disableNewTypeInference();
this.mode = saved;
}

void testWarningOtiNti(
String js, DiagnosticType otiWarning, DiagnosticType ntiWarning) {
TypeInferenceMode saved = this.mode;
Expand Down

0 comments on commit 11150b2

Please sign in to comment.