hasExcessProperty only uses valueDeclaration if available

Previously it would crash if valueDeclaration was not set
This commit is contained in:
Nathan Shively-Sanders 2017-06-08 14:15:24 -07:00
parent b94c51360b
commit 70069aeb31

View File

@ -8977,7 +8977,9 @@ namespace ts {
reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target));
}
else {
errorNode = prop.valueDeclaration;
if (prop.valueDeclaration) {
errorNode = prop.valueDeclaration;
}
reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
symbolToString(prop), typeToString(target));
}