mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibJS: Make AsyncGenerator and GeneratorObject factories infallible
These should never fail.
This commit is contained in:
committed by
Andreas Kling
parent
d8f5971ddf
commit
04238d0f3f
Notes:
github-actions[bot]
2025-11-17 22:44:15 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/04238d0f3f4 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6845
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user