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:
parent
cff8f56ce7
commit
2a563b9de6
Notes:
sideshowbarker
2024-07-17 06:09:44 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/2a563b9de6 Pull-request: https://github.com/SerenityOS/serenity/pull/20026
1 changed files with 1 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue