LibJS: Remove unnecessary check in for..in iterator implementation

This commit is contained in:
Andreas Kling 2025-03-19 18:48:49 -05:00 committed by Andreas Kling
parent fb3d1c2754
commit f6141df589
Notes: github-actions[bot] 2025-03-20 17:52:26 +00:00

View file

@ -1778,11 +1778,7 @@ inline ThrowCompletionOr<Object*> get_object_property_iterator(VM& vm, Value val
auto callback = NativeFunction::create(
*vm.current_realm(), [items = move(properties), result_object, value_offset, done_offset](VM& vm) mutable -> ThrowCompletionOr<Value> {
auto iterated_object_value = vm.this_value();
if (!iterated_object_value.is_object())
return vm.throw_completion<InternalError>("Invalid state for GetObjectPropertyIterator.next"sv);
auto& iterated_object = iterated_object_value.as_object();
auto& iterated_object = vm.this_value().as_object();
while (true) {
if (items.is_empty()) {
result_object->put_direct(done_offset, JS::Value(true));