From 8cd5760eb7a7ac9ad1e37e173bce2ae39d665c92 Mon Sep 17 00:00:00 2001 From: yfwang6 Date: Wed, 31 Aug 2022 10:30:36 +0800 Subject: [PATCH] wangyongfei6@huawei.com only validate stringliteral for component id Signed-off-by: yfwang6 Change-Id: I84a732cb1386176710fbecf5e60c49215f651d29 --- compiler/src/process_component_build.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 3b59830..2180ca8 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -946,7 +946,8 @@ function updateArgumentFor$$(argument: any): ts.Expression { function verifyComponentId(temp: any, node: ts.Identifier, propName: string, log: LogInfo[]): void { - if (!newsupplement.isAcceleratePreview && propName === ATTRIBUTE_ID) { + if (!newsupplement.isAcceleratePreview && propName === ATTRIBUTE_ID && + ts.isStringLiteral(temp.arguments[0])) { const id: string = temp.arguments[0].text; const posOfNode: ts.LineAndCharacter = transformLog.sourceFile .getLineAndCharacterOfPosition(getRealNodePos(node));