mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
LibJS: Convert create_data_property_or_throw() to ThrowCompletionOr
This commit is contained in:
parent
bb2499cd7a
commit
364dd42fc8
30 changed files with 148 additions and 167 deletions
|
@ -1300,9 +1300,7 @@ ThrowCompletionOr<Value> ClassExpression::class_definition_evaluation(Interprete
|
|||
if (initializer)
|
||||
field_value = TRY(interpreter.vm().call(*initializer, class_constructor_value));
|
||||
|
||||
class_constructor->create_data_property_or_throw(property_key, field_value);
|
||||
if (auto* exception = interpreter.exception())
|
||||
return throw_completion(exception->value());
|
||||
TRY(class_constructor->create_data_property_or_throw(property_key, field_value));
|
||||
} else {
|
||||
class_constructor->add_field(property_key, initializer);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue