mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibJS: Add Object::get_enumerable_own_property_names() and use it
Object::get_own_properties() is a bit unwieldy to use - especially as StringOnly is about to no longer be the default value. The spec has an abstract operation specifically for this (EnumerateObjectProperties), so let's use that. No functionality change.
This commit is contained in:
committed by
Andreas Kling
parent
afc86abe24
commit
1416027486
@@ -479,7 +479,7 @@ Value ForInStatement::execute(Interpreter& interpreter, GlobalObject& global_obj
|
||||
return {};
|
||||
auto* object = rhs_result.to_object(global_object);
|
||||
while (object) {
|
||||
auto property_names = object->get_own_properties(Object::PropertyKind::Key, true);
|
||||
auto property_names = object->get_enumerable_own_property_names(Object::PropertyKind::Key);
|
||||
for (auto& property_name : property_names.as_object().indexed_properties()) {
|
||||
interpreter.vm().set_variable(variable_name, property_name.value_and_attributes(object).value, global_object, has_declaration);
|
||||
if (interpreter.exception())
|
||||
|
||||
Reference in New Issue
Block a user