mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibJS: Convert the CreateDynamicFunction AO to ThrowCompletionOr
This commit is contained in:
parent
47f762ab42
commit
c0bb456fd2
Notes:
sideshowbarker
2024-07-18 01:47:18 +09:00
Author: https://github.com/IdanHo
Commit: c0bb456fd2
Pull-request: https://github.com/SerenityOS/serenity/pull/10675
Reviewed-by: https://github.com/linusg ✅
3 changed files with 8 additions and 13 deletions
|
@ -45,9 +45,7 @@ ThrowCompletionOr<Value> GeneratorFunctionConstructor::call()
|
|||
// 27.3.1.1 GeneratorFunction ( p1, p2, … , pn, body ), https://tc39.es/ecma262/#sec-generatorfunction
|
||||
ThrowCompletionOr<Object*> GeneratorFunctionConstructor::construct(FunctionObject& new_target)
|
||||
{
|
||||
auto function = FunctionConstructor::create_dynamic_function_node(global_object(), new_target, FunctionKind::Generator);
|
||||
if (auto* exception = vm().exception())
|
||||
return throw_completion(exception->value());
|
||||
auto function = TRY(FunctionConstructor::create_dynamic_function_node(global_object(), new_target, FunctionKind::Generator));
|
||||
|
||||
auto* bytecode_interpreter = Bytecode::Interpreter::current();
|
||||
VERIFY(bytecode_interpreter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue