Skip to content

Commit 62d99d3

Browse files
lauraharkercopybara-github
authored andcommitted
Run mergeSyntheticScript even in checksOnly mode
PiperOrigin-RevId: 622878192
1 parent d106bbb commit 62d99d3

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

src/com/google/javascript/jscomp/DefaultPassConfig.java

+5-8
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,11 @@ protected PassListBuilder getChecks() {
465465

466466
checks.maybeAdd(createEmptyPass(PassNames.AFTER_STANDARD_CHECKS));
467467

468-
if (options.checksOnly) {
469-
checks.maybeAdd(removeSyntheticScript);
470-
} else if (!options.checksOnly) {
471-
checks.maybeAdd(mergeSyntheticScript);
472-
// At this point all checks have been done.
473-
if (options.exportTestFunctions) {
474-
checks.maybeAdd(exportTestFunctions);
475-
}
468+
checks.maybeAdd(mergeSyntheticScript);
469+
470+
// At this point all checks have been done.
471+
if (!options.checksOnly && options.exportTestFunctions) {
472+
checks.maybeAdd(exportTestFunctions);
476473
}
477474

478475
// Create extern exports after the normalize because externExports depends on unique names.

test/com/google/javascript/jscomp/integration/TypedAstIntegrationTest.java

+7-9
Original file line numberDiff line numberDiff line change
@@ -761,15 +761,13 @@ public void testPolymer_propertiesOnLegacyElementNotRenamed_inGoogModule() throw
761761
" },",
762762
"});")));
763763

764-
// TODO(b/218711238): investigate this crash
765-
assertThrows(NullPointerException.class, () -> compileTypedAstShards(options));
766-
// Compiler compiler = compileTypedAstShards(options);
767-
// String source = compiler.toSource();
768-
769-
// // If we see these identifiers anywhere in the output source, we know that we successfully
770-
// // protected them against removal and renaming.
771-
// assertThat(source).contains("longUnusedProperty");
772-
// assertThat(source).contains("longUnusedMethod");
764+
Compiler compiler = compileTypedAstShards(options);
765+
String source = compiler.toSource();
766+
767+
// If we see these identifiers anywhere in the output source, we know that we successfully
768+
// protected them against removal and renaming.
769+
assertThat(source).contains("longUnusedProperty");
770+
assertThat(source).contains("longUnusedMethod");
773771
}
774772

775773
// use over 'compileTypedAstShards' if you want to validate reported errors or warnings in your

0 commit comments

Comments
 (0)