!1089 only validate stringliteral for component id

Merge pull request !1089 from yfwang6/cherry-pick-1662519128
This commit is contained in:
openharmony_ci
2022-09-07 08:35:57 +00:00
committed by Gitee
+2 -1
View File
@@ -909,7 +909,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));