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

LibJS: Let Object::delete_property() return a bool, not Value

Just like the various define_property functions, this should return a
bool directly and let the caller deal with wrapping it in a Value, if
necessary.
This commit is contained in:
Linus Groh 2021-04-10 17:44:12 +02:00 committed by Andreas Kling
parent 4788c94d34
commit ec62783af9
6 changed files with 20 additions and 20 deletions

View file

@ -683,11 +683,11 @@ Value UnaryExpression::execute(Interpreter& interpreter, GlobalObject& global_ob
// FIXME: Support deleting locals
VERIFY(!reference.is_local_variable());
if (reference.is_global_variable())
return global_object.delete_property(reference.name());
return Value(global_object.delete_property(reference.name()));
auto* base_object = reference.base().to_object(global_object);
if (!base_object)
return {};
return base_object->delete_property(reference.name());
return Value(base_object->delete_property(reference.name()));
}
Value lhs_result;