Skip to content

Commit

Permalink
Remove a few bad missingSourcesWarnings
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 601198653
  • Loading branch information
blickly authored and copybara-github committed Jan 25, 2024
1 parent 09babf4 commit 841eb8a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
5 changes: 1 addition & 4 deletions src/com/google/javascript/jscomp/DiagnosticGroups.java
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,12 @@ public static DiagnosticGroup forName(String name) {
REPORT_UNKNOWN_TYPES,
UNDEFINED_VARIABLES,
MISSING_PROVIDE,
DiagnosticGroup.forType(FunctionTypeBuilder.RESOLVED_TAG_EMPTY),
DiagnosticGroup.forType(MISSING_MODULE_OR_PROVIDE),
MISSING_PROPERTIES,
// triggered by typedefs with missing types
DUPLICATE_VARS,
// caused by a define depending on another define that's missing
DiagnosticGroup.forType(ProcessDefines.INVALID_DEFINE_VALUE),
// ES Module imports of files not reachable from this partial program.
DiagnosticGroup.forType(ModuleLoader.LOAD_WARNING));
DiagnosticGroup.forType(ProcessDefines.INVALID_DEFINE_VALUE));

public static final DiagnosticGroup STRICT_REQUIRES =
DiagnosticGroups.registerDeprecatedGroup("legacyGoogScopeRequire");
Expand Down
17 changes: 0 additions & 17 deletions test/com/google/javascript/jscomp/PartialCompilationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.javascript.rhino.jstype.FunctionType;
import com.google.javascript.rhino.jstype.JSType;
import com.google.javascript.rhino.jstype.NamedType;
import com.google.javascript.rhino.jstype.NoType;
Expand Down Expand Up @@ -204,20 +203,4 @@ public void testUnresolvedGenerics_defined() throws Exception {
" useMissing(new some.thing.Missing());",
"}");
}

@Test
public void testUnresolvedBaseClassDoesNotHideFields() throws Exception {
assertPartialCompilationSucceeds(
"/** @constructor @extends {MissingBase} */",
"var Klass = function () {",
" /** @type {string} */",
" this.foo;",
"};");
TypedVar x = compiler.getTopScope().getSlot("Klass");
JSType type = x.getType();
assertThat(type.isFunctionType()).isTrue();

FunctionType fType = (FunctionType) type;
assertThat(fType.getTypeOfThis().hasProperty("foo")).isTrue();
}
}

0 comments on commit 841eb8a

Please sign in to comment.