From efcb63e85e072238da6b2b5a5154641c1663b0c8 Mon Sep 17 00:00:00 2001 From: Bojiang Date: Fri, 8 Aug 2025 15:08:27 +0800 Subject: [PATCH] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码同步 Signed-off-by: Bojiang Change-Id: I7dc231d4b423aca203e8f1f67bdd075a919a8d1c --- compiler/sample/pages/testcases/simpleText.ets | 8 ++++---- compiler/src/process_component_class.ts | 2 +- compiler/src/process_component_member.ts | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/sample/pages/testcases/simpleText.ets b/compiler/sample/pages/testcases/simpleText.ets index d4c9065e9..1dfc91c02 100644 --- a/compiler/sample/pages/testcases/simpleText.ets +++ b/compiler/sample/pages/testcases/simpleText.ets @@ -46,15 +46,15 @@ struct UserView { } .width(700).backgroundColor("#b0c4de").margin(20) } else if(this.currentView === "button") { - Button("Button test:" + this.button_name) + Button('Button test:' + this.button_name) .width(600).height(100).backgroundColor("#b0c4de").margin(50) .onClick(() => { - console.log("Button test click start"); + console.log('Button test click start'); this.button_name = "After click"; - console.log("Button test click end"); + console.log('Button test click end'); }) } else if(this.currentView === "text") { - Text("Text test") + Text('Text test') .width(600).height(100).backgroundColor("#b0c4de") .margin(50).fontColor("#ff33aa").fontSize(50).fontWeight("bold") } else if(this.currentView === "image") { diff --git a/compiler/src/process_component_class.ts b/compiler/src/process_component_class.ts index 6591124a8..e39e30174 100644 --- a/compiler/src/process_component_class.ts +++ b/compiler/src/process_component_class.ts @@ -215,7 +215,7 @@ function processMembers(members: ts.NodeArray, parentComponentN } }); members.forEach((item: ts.ClassElement) => { - let updateItem: ts.ClassElement; + let updateItem: ts.ClassElement | undefined; if (ts.isPropertyDeclaration(item)) { if (isStaticProperty(item)) { newMembers.push(item); diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index c41bcda12..26ddb24be 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -172,7 +172,7 @@ export const stateObjectCollection: Set = new Set(); export class UpdateResult { private itemUpdate: boolean = false; private ctorUpdate: boolean = false; - private properity: ts.PropertyDeclaration; + private properity: ts.PropertyDeclaration | undefined; private ctor: ts.ConstructorDeclaration; private variableGet: ts.GetAccessorDeclaration; private variableSet: ts.SetAccessorDeclaration; @@ -183,7 +183,7 @@ export class UpdateResult { private decoratorName: string; private stateVarsParams: ts.Statement; - public setProperity(updateItem: ts.PropertyDeclaration): void { + public setProperity(updateItem: ts.PropertyDeclaration | undefined): void { this.itemUpdate = true; this.properity = updateItem; } @@ -237,7 +237,7 @@ export class UpdateResult { return this.ctorUpdate; } - public getProperity(): ts.PropertyDeclaration { + public getProperity(): ts.PropertyDeclaration | undefined { return this.properity; } -- Gitee