From 9302b0fd0426cd8fdab96600f3ce7c7089dfff6b Mon Sep 17 00:00:00 2001 From: lizhouze Date: Thu, 20 Jan 2022 11:26:11 +0800 Subject: [PATCH] fixed 1193146 from https://gitee.com/kage1/developtools_ace-ets2bundle/pulls/204 lizhouze@huawei.com Signed-off-by: lizhouze --- compiler/src/pre_process.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/src/pre_process.ts b/compiler/src/pre_process.ts index 53ba5476f..318ef8ea6 100644 --- a/compiler/src/pre_process.ts +++ b/compiler/src/pre_process.ts @@ -53,23 +53,23 @@ function parseVisual(resourcePath: string, content: string, log: LogInfo[]): str if (componentCollection.entryComponent && projectConfig.aceSuperVisualPath) { const sourceFile: ts.SourceFile = ts.createSourceFile(resourcePath, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); - if (sourceFile.statments) { - sourceFile.statments.forEach(statment => { - content = parseStatment(statment, content, log, resourcePath); + if (sourceFile.statements) { + sourceFile.statements.forEach(statement => { + content = parseStatement(statement, content, log, resourcePath); }); } } return content; } -function parseStatment(statement: ts.Statement, content: string, log: LogInfo[], +function parseStatement(statement: ts.Statement, content: string, log: LogInfo[], resourcePath: string): string { if (statement.kind === ts.SyntaxKind.ClassDeclaration && statement.name && statement.name.getText() === componentCollection.entryComponent) { const visualPath: string = findVisualFile(resourcePath); if (visualPath && fs.existsSync(visualPath) && statement.members) { statement.members.forEach(member => { - if (member.kind && member === ts.SyntaxKind.MethodDeclaration) { + if (member.kind && member.kind === ts.SyntaxKind.MethodDeclaration) { content = parseMember(member, content, log, visualPath) } }); -- Gitee