LibJS: Convert set_mutable_binding() to ThrowCompletionOr

Also add spec step comments to it while we're here.
This commit is contained in:
Linus Groh 2021-10-09 19:34:54 +01:00
parent ae397541fb
commit 7652138ce0
Notes: sideshowbarker 2024-07-18 02:52:20 +09:00
11 changed files with 68 additions and 52 deletions

View file

@ -534,7 +534,7 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
for (auto& declaration : functions_to_initialize) {
auto* function = ECMAScriptFunctionObject::create(global_object(), declaration.name(), declaration.body(), declaration.parameters(), declaration.function_length(), lex_environment, declaration.kind(), declaration.is_strict_mode(), declaration.might_need_arguments_object(), declaration.contains_direct_call_to_eval());
var_environment->set_mutable_binding(global_object(), declaration.name(), function, false);
MUST(var_environment->set_mutable_binding(global_object(), declaration.name(), function, false));
}
return {};