mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibJS: Convert set_mutable_binding() to ThrowCompletionOr
Also add spec step comments to it while we're here.
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 02:52:20 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/7652138ce00 Pull-request: https://github.com/SerenityOS/serenity/pull/10413 Reviewed-by: https://github.com/IdanHo ✅
@@ -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 {};
|
||||
|
||||
Reference in New Issue
Block a user