Merge pull request #16377 from Microsoft/fix-synthetic-properties-in-hasExcessProperties

Fix synthetic properties in hasExcessProperties
This commit is contained in:
Nathan Shively-Sanders
2017-06-08 15:49:51 -07:00
committed by GitHub
4 changed files with 79 additions and 1 deletions

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));
}