!3959 Fix AsyncFunctionAwait crash

Merge pull request !3959 from Gymee/fix_AsyncFunctionAwait_crash
This commit is contained in:
openharmony_ci 2023-04-21 03:59:52 +00:00 committed by Gitee
commit 5c4568b321
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -130,6 +130,7 @@ void JSAsyncFunction::AsyncFunctionAwait(JSThread *thread, const JSHandle<JSTagg
// 9.Set throwawayCapability.[[Promise]].[[PromiseIsHandled]] to true.
JSHandle<PromiseCapability> tcap =
JSPromise::NewPromiseCapability(thread, JSHandle<JSTaggedValue>::Cast(env->GetPromiseFunction()));
RETURN_IF_ABRUPT_COMPLETION(thread);
JSHandle<JSPromise>(thread, tcap->GetPromise())->SetPromiseIsHandled(true);
// 10.Perform ! PerformPromiseThen(promiseCapability.[[Promise]], onFulfilled, onRejected, throwawayCapability).