1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

LibJS: Convert to_object() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-12 19:24:57 +01:00
parent 9eb065a1f6
commit 52976bfac6
45 changed files with 239 additions and 490 deletions

View file

@ -220,11 +220,7 @@ ThrowCompletionOr<void> VM::binding_initialization(NonnullRefPtr<BindingPattern>
// 14.3.3.1 Runtime Semantics: PropertyBindingInitialization, https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-propertybindinginitialization
ThrowCompletionOr<void> VM::property_binding_initialization(BindingPattern const& binding, Value value, Environment* environment, GlobalObject& global_object)
{
auto* object = value.to_object(global_object);
if (!object) {
VERIFY(exception());
return JS::throw_completion(exception()->value());
}
auto* object = TRY(value.to_object(global_object));
HashTable<PropertyName, PropertyNameTraits> seen_names;
for (auto& property : binding.entries) {