!1090 only validate stringliteral for component id

Merge pull request !1090 from yfwang6/cherry-pick-1662519277
This commit is contained in:
openharmony_ci
2022-09-07 15:12:30 +00:00
committed by Gitee
+2 -1
View File
@@ -1548,7 +1548,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));