mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibJS: Make AsyncGenerator and GeneratorObject factories infallible
These should never fail.
This commit is contained in:
parent
d8f5971ddf
commit
04238d0f3f
Notes:
github-actions[bot]
2025-11-17 22:44:15 +00:00
Author: https://github.com/awesomekling
Commit: 04238d0f3f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6845
5 changed files with 9 additions and 11 deletions
|
|
@ -893,12 +893,10 @@ ThrowCompletionOr<Value> ECMAScriptFunctionObject::ordinary_call_evaluate_body(V
|
|||
if (kind() == FunctionKind::Normal)
|
||||
return result;
|
||||
|
||||
if (kind() == FunctionKind::AsyncGenerator) {
|
||||
auto async_generator_object = TRY(AsyncGenerator::create(*context.realm, result, this, context.copy()));
|
||||
return async_generator_object;
|
||||
}
|
||||
if (kind() == FunctionKind::AsyncGenerator)
|
||||
return AsyncGenerator::create(*context.realm, result, this, context.copy());
|
||||
|
||||
auto generator_object = TRY(GeneratorObject::create(*context.realm, result, this, context.copy()));
|
||||
auto generator_object = GeneratorObject::create(*context.realm, result, this, context.copy());
|
||||
|
||||
// NOTE: Async functions are entirely transformed to generator functions, and wrapped in a custom driver that returns a promise
|
||||
// See AwaitExpression::generate_bytecode() for the transformation.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue