From 9c60b287d5e66654b753bfcbb94dcd1dd7928baf Mon Sep 17 00:00:00 2001 From: laibo102 Date: Fri, 24 Jun 2022 15:32:57 +0800 Subject: [PATCH] Bugfix: fixed hasChild validate Signed-off-by: laibo102 Change-Id: I932616545bcba538c5ac8984ae6ff3a24495c814 --- compiler/src/validate_ui_syntax.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 511701c..f84d635 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -390,9 +390,9 @@ function checkNoChildComponent(node: ts.EtsComponentExpression, sourceFileNode: } function hasChild(node: ts.EtsComponentExpression, isCheckType: ParamType): boolean { - const nodeName: ts.Identifier = node.expression as ts.Identifier; - if (AUTOMIC_COMPONENT.has(nodeName.escapedText.toString()) || judgeComponentType( - nodeName, node, isCheckType) && getNextNode(node)) { + const nodeName: ts.Identifier = node.expression as ts.Identifier; + if ((AUTOMIC_COMPONENT.has(nodeName.escapedText.toString()) || judgeComponentType(nodeName, node, isCheckType)) && + getNextNode(node)) { return true; } return false; @@ -447,8 +447,8 @@ function hasNonSingleChild(node: ts.EtsComponentExpression, allComponentNames: S isCheckType: ParamType): boolean { const nodeName: ts.Identifier = node.expression as ts.Identifier; const BlockNode: ts.Block = getNextNode(node); - if (SINGLE_CHILD_COMPONENT.has(nodeName.escapedText.toString()) || !judgeComponentType( - nodeName, node, isCheckType) && isCheckType.value === COMPONENT_BUTTON) { + if ((SINGLE_CHILD_COMPONENT.has(nodeName.escapedText.toString()) || !judgeComponentType(nodeName, node, isCheckType)) + && isCheckType.value === COMPONENT_BUTTON) { if (!BlockNode) { return false; }