From 0e1d91bd2b62c6129cf426e20990e4b8f5f9091b Mon Sep 17 00:00:00 2001 From: igorlegalov Date: Sat, 12 Jul 2025 15:43:25 +0300 Subject: [PATCH] Remove NullishType alias Issue: https://gitee.com/open_harmony/dashboard?issue_id=ICH95I Testing: all pre-merge tests passed Signed-off-by: igorlegalov --- .../ets/ets/@ohos.app.ability.InsightIntentContext.ets | 4 ++-- .../ets/ets/@ohos.app.ability.ServiceExtensionAbility.ets | 2 +- .../ets/ets/@ohos.app.ability.UIExtensionContentSession.ets | 4 ++-- frameworks/ets/ets/@ohos.app.ability.Want.ets | 6 +++--- frameworks/ets/ets/@ohos.app.ability.abilityManager.ets | 2 +- frameworks/ets/ets/application/UIAbilityContext.ets | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/frameworks/ets/ets/@ohos.app.ability.InsightIntentContext.ets b/frameworks/ets/ets/@ohos.app.ability.InsightIntentContext.ets index 40a7569f487..61ea24cf3f0 100644 --- a/frameworks/ets/ets/@ohos.app.ability.InsightIntentContext.ets +++ b/frameworks/ets/ets/@ohos.app.ability.InsightIntentContext.ets @@ -25,7 +25,7 @@ export default class InsightIntentContext { let p1 = taskpool.execute((): BusinessError => { return this.nativeStartAbilitySync(want); }); - p1.then((e: NullishType) => { + p1.then((e: Any) => { let retError = e as BusinessError; callback(retError, undefined); }, (err: BusinessError): void => { @@ -38,7 +38,7 @@ export default class InsightIntentContext { let p1 = taskpool.execute((): BusinessError => { return this.nativeStartAbilitySync(want); }); - p1.then((e: NullishType) => { + p1.then((e: Any) => { let retError = e as BusinessError; if (retError.code === 0) { resolve(undefined); diff --git a/frameworks/ets/ets/@ohos.app.ability.ServiceExtensionAbility.ets b/frameworks/ets/ets/@ohos.app.ability.ServiceExtensionAbility.ets index b9cba009044..60028426879 100644 --- a/frameworks/ets/ets/@ohos.app.ability.ServiceExtensionAbility.ets +++ b/frameworks/ets/ets/@ohos.app.ability.ServiceExtensionAbility.ets @@ -40,7 +40,7 @@ export default class ServiceExtensionAbility { private native nativeOnConnectCallback(service: rpc.RemoteObject): boolean; - private checkPromise(obj: NullishType): boolean { + private checkPromise(obj: Any): boolean { if (obj instanceof Promise) { return true; } diff --git a/frameworks/ets/ets/@ohos.app.ability.UIExtensionContentSession.ets b/frameworks/ets/ets/@ohos.app.ability.UIExtensionContentSession.ets index bb7fe873a25..d19c05e3dfe 100644 --- a/frameworks/ets/ets/@ohos.app.ability.UIExtensionContentSession.ets +++ b/frameworks/ets/ets/@ohos.app.ability.UIExtensionContentSession.ets @@ -126,7 +126,7 @@ export default class UIExtensionContentSession { let p1 = taskpool.execute((): BusinessError => { return this.nativeStartAbilityByTypeSync(type, wantParam, startCallback); }); - p1.then((e: NullishType) => { + p1.then((e: Any) => { let retError = e as BusinessError; if (retError.code === 0) { callback(null, undefined); @@ -144,7 +144,7 @@ export default class UIExtensionContentSession { let p1 = taskpool.execute((): BusinessError => { return this.nativeStartAbilityByTypeSync(type, wantParam, startCallback); }); - p1.then((e: NullishType) => { + p1.then((e: Any) => { let retError = e as BusinessError; if (retError.code === 0) { resolve(undefined); diff --git a/frameworks/ets/ets/@ohos.app.ability.Want.ets b/frameworks/ets/ets/@ohos.app.ability.Want.ets index 0eb0cec5513..51521764732 100644 --- a/frameworks/ets/ets/@ohos.app.ability.Want.ets +++ b/frameworks/ets/ets/@ohos.app.ability.Want.ets @@ -17,7 +17,7 @@ import hilog from '@ohos.hilog' import rpc from '@ohos.rpc'; import { RecordData } from '@ohos.base'; -type valueType = NullishType; +type valueType = Any; const DOMAIN_ID = 0xD001300; const TAG = 'WantSerializeTool'; @@ -30,7 +30,7 @@ class RecordWriter { return this.buffer.toString(); } - private writeObject(obj: NullishType): void { + private writeObject(obj: Any): void { if (obj === null) { this.buffer.append('null'); } else if (obj === undefined) { @@ -156,7 +156,7 @@ class RecordWriter { export class RecordSerializeTool { public static stringifyNoThrow(obj: Record): String { try { - return JSON.stringify(obj as Object as Record); + return JSON.stringify(obj as Object as Record); } catch (err) { hilog.error(DOMAIN_ID, TAG, `RecordSerializeTool.stringify error: ${err}`); return ''; diff --git a/frameworks/ets/ets/@ohos.app.ability.abilityManager.ets b/frameworks/ets/ets/@ohos.app.ability.abilityManager.ets index de13d525636..1145a09b6bb 100644 --- a/frameworks/ets/ets/@ohos.app.ability.abilityManager.ets +++ b/frameworks/ets/ets/@ohos.app.ability.abilityManager.ets @@ -48,7 +48,7 @@ export default namespace abilityManager { return nativeGetForegroundUIAbilities(); }; let p1 = taskpool.execute(executeFunc); - p1.then((e :NullishType)=>{ + p1.then((e :Any)=>{ let abilities: Array = e as Array; resolve(abilities); }, (err: Error): void => { diff --git a/frameworks/ets/ets/application/UIAbilityContext.ets b/frameworks/ets/ets/application/UIAbilityContext.ets index df5a451dd7f..cf65eea1426 100644 --- a/frameworks/ets/ets/application/UIAbilityContext.ets +++ b/frameworks/ets/ets/application/UIAbilityContext.ets @@ -465,7 +465,7 @@ export default class UIAbilityContext extends Context { let p1 = taskpool.execute((): BusinessError => { return this.nativeStartAbilityByTypeSync(type, wantParam, startCallback); }); - p1.then((e: NullishType) => { + p1.then((e: Any) => { let retError = e as BusinessError; if (retError.code === 0) { callback(null, undefined); @@ -517,7 +517,7 @@ hideAbility(): Promise { let p1 = taskpool.execute((): BusinessError => { return this.nativeStartAbilityByTypeSync(type, wantParam, startCallback); }); - p1.then((e: NullishType) => { + p1.then((e: Any) => { let retError = e as BusinessError; if (retError.code === 0) { resolve(undefined); -- Gitee