Skip to content

Commit 745aa61

Browse files
concavelenzcopybara-github
authored andcommitted
Automated Code Change
PiperOrigin-RevId: 860203411
1 parent c436c63 commit 745aa61

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
public final class ClosureRewriteModuleTest extends CompilerTestCase {
4545

4646
private boolean preserveClosurePrimitives = false;
47+
private boolean allowMissingSources = false;
4748

4849
public ClosureRewriteModuleTest() {
4950
super(new TestExternsBuilder().addClosureExterns().addPromise().addConsole().build());
@@ -69,6 +70,7 @@ protected CompilerPass getProcessor(Compiler compiler) {
6970
public void setUp() throws Exception {
7071
super.setUp();
7172
preserveClosurePrimitives = false;
73+
allowMissingSources = false;
7274
enableCreateModuleMap();
7375
enableTypeInfoValidation();
7476
}
@@ -80,6 +82,9 @@ protected CompilerOptions getOptions() {
8082
options.setPreserveClosurePrimitives(this.preserveClosurePrimitives);
8183
options.setWarningLevel(DiagnosticGroups.MISSING_PROVIDE, CheckLevel.WARNING);
8284
options.setWarningLevel(DiagnosticGroups.MODULE_LOAD, CheckLevel.OFF);
85+
if (allowMissingSources) {
86+
options.setWarningLevel(DiagnosticGroups.MISSING_SOURCES_WARNINGS, CheckLevel.OFF);
87+
}
8388
options.setPrettyPrint(true);
8489
return options;
8590
}
@@ -1638,18 +1643,17 @@ async function test() {
16381643

16391644
@Test
16401645
public void testGoogRequireDynamic_then_missingSources() {
1646+
allowMissingSources = true;
16411647
test(
16421648
srcs(
16431649
"""
16441650
async function test() {
1645-
/** @suppress {missingSourcesWarnings} */
16461651
goog.requireDynamic('a.b.c').then((foo) => {console.log(foo.Foo);});
16471652
}
16481653
"""),
16491654
expected(
16501655
"""
16511656
async function test() {
1652-
/** @suppress {missingSourcesWarnings} */
16531657
null.then((foo) => {console.log(foo.Foo);});
16541658
}
16551659
"""));

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29007,14 +29007,14 @@ public void testSymbolIteratorMethod() {
2900729007
public void testGoogRequireDynamic_missingSources() {
2900829008
// regression test for case that used to throw an exception
2900929009
newTest()
29010+
// reference to dynamically loaded namespace.
29011+
.suppress(DiagnosticGroups.MISSING_SOURCES_WARNINGS)
2901029012
.addSource(
2901129013
"""
2901229014
class Test {
2901329015
/**
2901429016
* @return {!Object}
2901529017
*
29016-
* @suppress {missingSourcesWarnings} reference to dynamically loaded
29017-
* namespace.
2901829018
* @suppress {checkTypes}
2901929019
*/
2902029020
testGoogRequireDynamicStubbedAndWithLoadedModule() {

0 commit comments

Comments
 (0)