mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +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
Notes:
sideshowbarker
2024-07-18 20:45:00 +09:00
Author: https://github.com/linusg
Commit: 1416027486
Pull-request: https://github.com/SerenityOS/serenity/pull/6150
4 changed files with 13 additions and 4 deletions
|
@ -209,7 +209,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::keys)
|
|||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
return obj_arg->get_own_properties(PropertyKind::Key, true);
|
||||
return obj_arg->get_enumerable_own_property_names(PropertyKind::Key);
|
||||
}
|
||||
|
||||
JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::values)
|
||||
|
@ -222,7 +222,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::values)
|
|||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
return obj_arg->get_own_properties(PropertyKind::Value, true);
|
||||
return obj_arg->get_enumerable_own_property_names(PropertyKind::Value);
|
||||
}
|
||||
|
||||
JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::entries)
|
||||
|
@ -235,7 +235,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::entries)
|
|||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
return obj_arg->get_own_properties(PropertyKind::KeyAndValue, true);
|
||||
return obj_arg->get_enumerable_own_property_names(PropertyKind::KeyAndValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue