mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-04 17:33:04 +00:00
LibJS: Convert the InitializeReferencedBinding AO to ThrowCompletionOr
This commit is contained in:
parent
1aaaf521b8
commit
853fab352d
Notes:
sideshowbarker
2024-07-18 01:33:33 +09:00
Author: https://github.com/IdanHo
Commit: 853fab352d
Pull-request: https://github.com/SerenityOS/serenity/pull/10765
Reviewed-by: https://github.com/linusg ✅
4 changed files with 15 additions and 33 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue