LibJS: Convert has_property() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-03 02:00:39 +01:00
commit f38a5957bf
Notes: sideshowbarker 2024-07-18 03:07:10 +09:00
11 changed files with 53 additions and 135 deletions

View file

@ -1283,7 +1283,7 @@ Value in(GlobalObject& global_object, Value lhs, Value rhs)
auto lhs_property_key = lhs.to_property_key(global_object);
if (global_object.vm().exception())
return {};
return Value(rhs.as_object().has_property(lhs_property_key));
return Value(TRY_OR_DISCARD(rhs.as_object().has_property(lhs_property_key)));
}
// 13.10.2 InstanceofOperator ( V, target ), https://tc39.es/ecma262/#sec-instanceofoperator