Skip to content

Commit bcba51d

Browse files
author
Kanchalai Tanglertsampan
committed
Address comment: remove reducdant check
1 parent a088cf4 commit bcba51d

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

src/compiler/checker.ts

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13169,20 +13169,14 @@ namespace ts {
1316913169
const paramType = getTypeAtPosition(signature, 0);
1317013170
const argType = checkExpressionWithContextualType(node.attributes, paramType, /*contextualMapper*/ undefined);
1317113171
const argProperties = getPropertiesOfType(argType);
13172-
const paramProperties = getPropertiesOfType(paramType);
13173-
if (argProperties.length === paramProperties.length && checkTypeRelatedTo(argType, paramType, relation, /*errorNode*/ undefined, headMessage)) {
13174-
return true;
13175-
}
13176-
else {
13177-
for (const arg of argProperties) {
13178-
if (!getPropertyOfType(paramType, arg.name) && isUnhyphenatedJsxName(arg.name)) {
13179-
return false;
13180-
}
13181-
}
13182-
if (checkTypeRelatedTo(argType, paramType, relation, /*errorNode*/ undefined, headMessage)) {
13183-
return true;
13172+
for (const arg of argProperties) {
13173+
if (!getPropertyOfType(paramType, arg.name) && isUnhyphenatedJsxName(arg.name)) {
13174+
return false;
1318413175
}
1318513176
}
13177+
if (checkTypeRelatedTo(argType, paramType, relation, /*errorNode*/ undefined, headMessage)) {
13178+
return true;
13179+
}
1318613180
return false;
1318713181
}
1318813182

@@ -13723,9 +13717,6 @@ namespace ts {
1372313717
return resolveErrorCall(node);
1372413718

1372513719
function reportError(message: DiagnosticMessage, arg0?: string, arg1?: string, arg2?: string): void {
13726-
if (isJsxOpeningOrSelfClosingElement) {
13727-
return;
13728-
}
1372913720
let errorInfo: DiagnosticMessageChain;
1373013721
errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2);
1373113722
if (headMessage) {
@@ -14125,7 +14116,7 @@ namespace ts {
1412514116
let result: Signature;
1412614117
for (const type of types) {
1412714118
// This is mainly to fill in all the candidates if there is one.
14128-
result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray);
14119+
result = result && resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray);
1412914120
}
1413014121

1413114122
return result;

0 commit comments

Comments
 (0)