mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
LibJS: Also throw exception when returning throw completion from await
...for now - the reason being that the AST breaks 'completion bubbling' and returns a plain Value, and code at the call site relies on the VM having an exception set when converting the plain value back into a completion. Fixes #11301.
This commit is contained in:
parent
416b0374fb
commit
1c05d39abc
1 changed files with 4 additions and 0 deletions
|
@ -115,6 +115,10 @@ ThrowCompletionOr<Value> await(GlobalObject& global_object, Value value)
|
|||
|
||||
if (success.value())
|
||||
return result;
|
||||
// NOTE: This is temporary until we remove VM::exception(). It's required as callers of
|
||||
// AwaitExpression still need to check for an exception rather than a completion
|
||||
// type as long as ASTNode::execute() returns a plain Value.
|
||||
vm.throw_exception(global_object, result);
|
||||
return throw_completion(result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue