@@ -16322,8 +16322,12 @@ namespace ts {
16322
16322
const propName = symbolToString(prop);
16323
16323
const suggestionSymbol = getSuggestedSymbolForNonexistentJSXAttribute(propName, errorTarget);
16324
16324
const suggestion = suggestionSymbol ? symbolToString(suggestionSymbol) : undefined;
16325
- if (suggestion) reportError(Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(errorTarget), suggestion);
16326
- else reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget));
16325
+ if (suggestion) {
16326
+ reportError(Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName, typeToString(errorTarget), suggestion);
16327
+ }
16328
+ else {
16329
+ reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName, typeToString(errorTarget));
16330
+ }
16327
16331
}
16328
16332
else {
16329
16333
// use the property's value declaration if the property is assigned inside the literal itself
@@ -24884,8 +24888,8 @@ namespace ts {
24884
24888
function getSuggestedSymbolForNonexistentJSXAttribute(name: Identifier | PrivateIdentifier | string, containingType: Type): Symbol | undefined {
24885
24889
const strName = isString(name) ? name : idText(name);
24886
24890
const properties = getPropertiesOfType(containingType);
24887
- const jsxSpecific = strName === "for" ? properties. find(x => symbolName(x) === "htmlFor")
24888
- : strName === "class" ? properties. find(x => symbolName(x) === "className")
24891
+ const jsxSpecific = strName === "for" ? find(properties, x => symbolName(x) === "htmlFor")
24892
+ : strName === "class" ? find(properties, x => symbolName(x) === "className")
24889
24893
: undefined;
24890
24894
return jsxSpecific ?? getSpellingSuggestionForName(strName, properties, SymbolFlags.Value);
24891
24895
}
@@ -28236,7 +28240,7 @@ namespace ts {
28236
28240
error(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference);
28237
28241
return booleanType;
28238
28242
}
28239
- if (expr.kind === SyntaxKind.PropertyAccessExpression && isPrivateIdentifier(expr.name)) {
28243
+ if (isPropertyAccessExpression( expr) && isPrivateIdentifier(expr.name)) {
28240
28244
error(expr, Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier);
28241
28245
}
28242
28246
const links = getNodeLinks(expr);
0 commit comments