mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:07:45 +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:
parent
afc86abe24
commit
1416027486
4 changed files with 13 additions and 4 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue