From 44b2c3278b7af4cc6978596329a7612c308f7719 Mon Sep 17 00:00:00 2001 From: yanpeng Date: Thu, 26 Oct 2023 15:38:40 +0800 Subject: [PATCH] test262 async testcase Problem Solving Signed-off-by: yanpeng --- es2panda/compiler/function/functionBuilder.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/es2panda/compiler/function/functionBuilder.cpp b/es2panda/compiler/function/functionBuilder.cpp index 10a02a800b..9167371e72 100644 --- a/es2panda/compiler/function/functionBuilder.cpp +++ b/es2panda/compiler/function/functionBuilder.cpp @@ -303,7 +303,9 @@ void FunctionBuilder::YieldStar(const ir::AstNode *node) pg_->LoadAccumulatorInt(node, static_cast(ResumeMode::THROW)); // d. Assert: awaited.[[Type]] is normal. // e. Return Completion { [[Type]]: return, [[Value]]: awaited.[[Value]], [[Target]]: empty }. - pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, receivedType, returnCompletion); + pg_->Condition(node, lexer::TokenType::PUNCTUATOR_NOT_EQUAL, receivedType, loopStart); + pg_->LoadAccumulatorInt(node, static_cast(ResumeMode::RETURN)); + pg_->StoreAccumulator(node, receivedType); } else { // vii. Else, set received to GeneratorYield(innerResult). // 8. Else, set received to GeneratorYield(innerResult). -- Gitee