diff --git a/src/com/google/javascript/jscomp/DefaultPassConfig.java b/src/com/google/javascript/jscomp/DefaultPassConfig.java index b7fce44ddad..88c55fced4f 100644 --- a/src/com/google/javascript/jscomp/DefaultPassConfig.java +++ b/src/com/google/javascript/jscomp/DefaultPassConfig.java @@ -383,21 +383,15 @@ protected List getChecks() { TranspilationPasses.addEs2017Passes(checks); } - if (options.needsTranspilationFrom(ES7) && !options.getTypeCheckEs6Natively()) { + if (options.needsTranspilationFrom(ES7)) { TranspilationPasses.addEs2016Passes(checks); } if (options.needsTranspilationFrom(ES6)) { checks.add(es6ExternsCheck); TranspilationPasses.addEs6EarlyPasses(checks); - } - - if (options.needsTranspilationFrom(ES6)) { - if (options.getTypeCheckEs6Natively()) { - TranspilationPasses.addEs6PassesBeforeNTI(checks); - } else { - TranspilationPasses.addEs6LatePasses(checks); - } + // TODO(bradfordcsmith): Combine early and late passes into a single method. + TranspilationPasses.addEs6LatePasses(checks); } if (options.rewritePolyfills && !options.checksOnly) { @@ -412,23 +406,6 @@ protected List getChecks() { checks.add(convertStaticInheritance); } - // End of ES6 transpilation passes before NTI. - - if (options.getTypeCheckEs6Natively()) { - if (!options.skipNonTranspilationPasses) { - checks.add(createEmptyPass(PassNames.BEFORE_TYPE_CHECKING)); - addNewTypeCheckerPasses(checks, options); - } - - if (options.needsTranspilationFrom(ES7)) { - TranspilationPasses.addEs2016Passes(checks); - } - - if (options.needsTranspilationFrom(ES6)) { - TranspilationPasses.addEs6PassesAfterNTI(checks); - } - } - if (!options.skipNonTranspilationPasses) { addNonTranspilationCheckPasses(checks); } @@ -466,10 +443,8 @@ protected List getChecks() { } private void addNonTranspilationCheckPasses(List checks) { - if (!options.getTypeCheckEs6Natively()) { - checks.add(createEmptyPass(PassNames.BEFORE_TYPE_CHECKING)); - addNewTypeCheckerPasses(checks, options); - } + checks.add(createEmptyPass(PassNames.BEFORE_TYPE_CHECKING)); + addNewTypeCheckerPasses(checks, options); if (!options.getNewTypeInference()) { addOldTypeCheckerPasses(checks, options); diff --git a/test/com/google/javascript/jscomp/TranspileAfterNTITest.java b/test/com/google/javascript/jscomp/TranspileAfterNTITest.java index c08ee80a9cc..7f0c0319bec 100644 --- a/test/com/google/javascript/jscomp/TranspileAfterNTITest.java +++ b/test/com/google/javascript/jscomp/TranspileAfterNTITest.java @@ -28,6 +28,13 @@ /** * Integration tests that check types of nodes are correct after running transpilation after NTI. + * + * TODO(b/72551201): Remove this entire test class once NTI is completely removed. + * + * Some of the test cases are already disabled, because we've removed the logic from + * DefaultPassConfig that allows for running NTI before (some parts of) transpilation. + * They aren't deleted, because they may serve as good models for test cases on OTI as we update it + * to understand the language features tested here. */ public final class TranspileAfterNTITest extends IntegrationTestCase { @@ -139,7 +146,8 @@ public void testMemberFunctionDef() { assertType(s.getFirstFirstChild().getTypeI()).toStringIsEqualTo("function(number): string"); } - public void testComputedProp1() { + // See class javadoc for why this is disabled. + public void disabledTestComputedProp1() { Node root = typeInfoCheckAndGetRoot( LINE_JOINER.join( @@ -175,7 +183,8 @@ public void testComputedProp1() { assertType(firstName.getTypeI()).isString(); } - public void testComputedProp2() { + // See class javadoc for why this is disabled. + public void disabledTestComputedProp2() { Node root = typeInfoCheckAndGetRoot( "var i = 1; var obj = {'a': i , [i + 1]: 1};", @@ -329,7 +338,8 @@ public void testTemplateString() { assertType(template.getFirstFirstChild().getSecondChild().getTypeI()).isNumber(); } - public void testTaggedTemplate1() { + // See class javadoc for why this is disabled. + public void disabledTestTaggedTemplate1() { Node root = typeInfoCheckAndGetRoot( LINE_JOINER.join( @@ -370,7 +380,8 @@ public void testTaggedTemplate1() { assertType(s.getFirstFirstChild().getChildAtIndex(2).getTypeI()).isNumber(); } - public void testTaggedTemplate2() { + // See class javadoc for why this is disabled. + public void disabledTestTaggedTemplate2() { Node root = typeInfoCheckAndGetRoot( LINE_JOINER.join(