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
parent 74fb2fdaa2
commit 5f29260de7
+3 -1
View File
@@ -349,8 +349,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);