mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibJS: Convert the InitializeReferencedBinding AO to ThrowCompletionOr
This commit is contained in:
committed by
Linus Groh
parent
1aaaf521b8
commit
853fab352d
Notes:
sideshowbarker
2024-07-18 01:33:33 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/853fab352d3 Pull-request: https://github.com/SerenityOS/serenity/pull/10765 Reviewed-by: https://github.com/linusg ✅
@@ -426,12 +426,9 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
|
||||
return throw_completion(exception->value());
|
||||
// Here the difference from hasDuplicates is important
|
||||
if (has_duplicates)
|
||||
TRY(reference.put_value(global_object(), argument_value));
|
||||
return reference.put_value(global_object(), argument_value);
|
||||
else
|
||||
reference.initialize_referenced_binding(global_object(), argument_value);
|
||||
if (auto* exception = vm.exception())
|
||||
return throw_completion(exception->value());
|
||||
return {};
|
||||
return reference.initialize_referenced_binding(global_object(), argument_value);
|
||||
} else if (IsSame<NonnullRefPtr<BindingPattern> const&, decltype(param)>) {
|
||||
// Here the difference from hasDuplicates is important
|
||||
return vm.binding_initialization(param, argument_value, used_environment, global_object());
|
||||
|
||||
Reference in New Issue
Block a user