From ccbff4b9320552221e59c6b04ae5bfdd1fe842da Mon Sep 17 00:00:00 2001 From: zihan Date: Wed, 6 Aug 2025 17:43:35 +0800 Subject: [PATCH] Fix TypeError No Return Value Issue: https://https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICM3Z3 Reason: TypeError: no return value Description: Fix TypeError Tests: ninja tests passed tests/tests-u-runner/runner.sh --ets-cts --show-progress --build-dir x64.release --processes=all passed tests/tests-u-runner/runner.sh --ets-func-tests --show-progress --build-dir x64.release --processes=all passed tests/tests-u-runner/runner.sh --astchecker --show-progress --build-dir x64.release --processes=all passed tests/tests-u-runner/runner.sh --ets-runtime --show-progress --build-dir x64.release --processes=all passed tests/tests-u-runner/runner.sh --parser --no-js --show-progress --build-dir x64.release --processes=all passe Signed-off-by: Mingyang Change-Id: b150c3f48125fe20346ef2d3f397a40ba995f856 --- frameworks/ets/ets/@ohos.app.ability.UIAbility.ets | 2 +- frameworks/ets/ets/application/AbilityDelegator.ets | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frameworks/ets/ets/@ohos.app.ability.UIAbility.ets b/frameworks/ets/ets/@ohos.app.ability.UIAbility.ets index 6c305252859..6aede11d5e0 100644 --- a/frameworks/ets/ets/@ohos.app.ability.UIAbility.ets +++ b/frameworks/ets/ets/@ohos.app.ability.UIAbility.ets @@ -174,7 +174,7 @@ export default class UIAbility extends Ability { onPrepareToTerminateAsync(): Promise { return new Promise((resolve: (a: boolean) => void, - reject: (err: Error) => void): boolean => { + reject: (err: Error) => void) => { }); } diff --git a/frameworks/ets/ets/application/AbilityDelegator.ets b/frameworks/ets/ets/application/AbilityDelegator.ets index fec39c5bcea..56490855ead 100644 --- a/frameworks/ets/ets/application/AbilityDelegator.ets +++ b/frameworks/ets/ets/application/AbilityDelegator.ets @@ -461,7 +461,7 @@ class AbilityDelegatorInner implements AbilityDelegator { getCurrentTopAbility(callback: AsyncCallback): void { let getCurrentTopAbilityCall = new AsyncCallbackWrapper(callback); let p = taskpool.execute((): UIAbility => { - this.nativeGetCurrentTopAbility(getCurrentTopAbilityCall) + return this.nativeGetCurrentTopAbility(getCurrentTopAbilityCall) }); console.log("getCurrentTopAbility callback2_04"); } @@ -476,7 +476,7 @@ class AbilityDelegatorInner implements AbilityDelegator { } }); taskpool.execute((): UIAbility => { - this.nativeGetCurrentTopAbility(getCurrentTopAbilityCall); + return this.nativeGetCurrentTopAbility(getCurrentTopAbilityCall); }); }); return p; -- Gitee