mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibJS/Bytecode: Correctly rethrow exception in await expression
We were implicitly converting the throw completion's value into a normal completion in `AsyncFunctionDriverWrapper::continue_async_execution`, which meant the routine generated by `generate_await` didn't know that the value had to be thrown when execution resumed. Without this change, we mistakenly pass 13 tests for `Array.fromAsync`, which we do not implement yet. But even with that "regression", we pass 17 more test262 tests in total.
This commit is contained in:
committed by
Andreas Kling
parent
cff8f56ce7
commit
2a563b9de6
@@ -114,7 +114,7 @@ void AsyncFunctionDriverWrapper::continue_async_execution(VM& vm, Value value, b
|
||||
continue;
|
||||
}
|
||||
if (m_current_promise->state() == Promise::State::Rejected) {
|
||||
generator_result = m_generator_object->resume_abrupt(vm, m_current_promise->result(), {});
|
||||
generator_result = m_generator_object->resume_abrupt(vm, throw_completion(m_current_promise->result()), {});
|
||||
continue;
|
||||
}
|
||||
// Due to the nature of promise capabilities we might get called on either one path,
|
||||
|
||||
Reference in New Issue
Block a user