only validate stringliteral for component id

Signed-off-by: yfwang6 <wangyongfei6@huawei.com>
Change-Id: I84a732cb1386176710fbecf5e60c49215f651d29
This commit is contained in:
yfwang6
2022-08-31 10:30:36 +08:00
parent b07099f4b9
commit 8cd5760eb7
+2 -1
View File
@@ -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));