1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

LibJS: Convert create_global_function_binding() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-12-29 16:02:44 +01:00
parent 4767be1459
commit 87a89e7126
4 changed files with 8 additions and 18 deletions

View file

@ -3725,9 +3725,7 @@ ThrowCompletionOr<void> Program::global_declaration_instantiation(Interpreter& i
for (auto& declaration : functions_to_initialize) {
auto* function = ECMAScriptFunctionObject::create(global_object, declaration.name(), declaration.body(), declaration.parameters(), declaration.function_length(), &global_environment, private_environment, declaration.kind(), declaration.is_strict_mode(), declaration.might_need_arguments_object(), declaration.contains_direct_call_to_eval());
global_environment.create_global_function_binding(declaration.name(), function, false);
if (auto* exception = interpreter.exception())
return throw_completion(exception->value());
TRY(global_environment.create_global_function_binding(declaration.name(), function, false));
}
for (auto& var_name : declared_var_names)