mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +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:
parent
1f6a0ef6e0
commit
de514f29ad
4 changed files with 47 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue