mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibJS: Align codegen AwaitExpressions to YieldExpressions
We use generators in bytecode to approximate async functions, but the code generated by AwaitExpressions did not have the value processing paths that Yield requires, eg the `generator.throw()` path, which is used by AsyncFunctionDriverWrapper to signal Promise rejections.
This commit is contained in:
@@ -65,7 +65,11 @@ public:
|
||||
VERIFY(unwind_contexts().last().finalizer);
|
||||
jump(Label { *unwind_contexts().last().finalizer });
|
||||
}
|
||||
void do_return(Value return_value) { m_return_value = return_value; }
|
||||
void do_return(Value return_value)
|
||||
{
|
||||
m_return_value = return_value;
|
||||
m_saved_exception = {};
|
||||
}
|
||||
|
||||
void enter_unwind_context(Optional<Label> handler_target, Optional<Label> finalizer_target);
|
||||
void leave_unwind_context();
|
||||
|
||||
Reference in New Issue
Block a user