Skip to content

Commit 70069ae

Browse files
committed
hasExcessProperty only uses valueDeclaration if available
Previously it would crash if valueDeclaration was not set
1 parent b94c513 commit 70069ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8977,7 +8977,9 @@ namespace ts {
89778977
reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target));
89788978
}
89798979
else {
8980-
errorNode = prop.valueDeclaration;
8980+
if (prop.valueDeclaration) {
8981+
errorNode = prop.valueDeclaration;
8982+
}
89818983
reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
89828984
symbolToString(prop), typeToString(target));
89838985
}

0 commit comments

Comments
 (0)