puuyajun@huawei.com

fix debugline getName function

Signed-off-by: puyajun <puyajun@huawei.com>
This commit is contained in:
puyajun
2022-03-30 16:58:15 +08:00
committed by 蒲亚军
parent 89749e4106
commit 25423aea88
+3 -1
View File
@@ -351,8 +351,10 @@ function processInnerComponent(node: ts.ExpressionStatement, index: number, arr:
const debugInfo: string =
`${path.relative(projectPath, curFileName).replace(/\\+/g, '/')}` +
`(${posOfNode.line + line}:${posOfNode.character + col})`;
const nameResult: NameResult = { name: null };
validateEtsComponentNode(node.expression as ts.EtsComponentExpression, nameResult);
const debugNode: ts.ExpressionStatement = ts.factory.createExpressionStatement(
createFunction(ts.factory.createIdentifier(getName(node)),
createFunction(ts.factory.createIdentifier(nameResult.name),
ts.factory.createIdentifier(COMPONENT_DEBUGLINE_FUNCTION),
ts.factory.createNodeArray([ts.factory.createStringLiteral(debugInfo)])));
newStatements.push(debugNode);