1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:47:35 +00:00

js: Ignore property attributes for completion

Only being able to complete enumerable properties is annoying,
especially since we updated everything to use the correct attributes.

Most standard built-in objects are *not* enumerable.
This commit is contained in:
Linus Groh 2020-05-02 16:01:09 +01:00 committed by Andreas Kling
parent 628777f94a
commit ce0bed0482

View file

@ -617,12 +617,10 @@ int main(int argc, char** argv)
Function<void(const JS::Shape&, const StringView&)> list_all_properties = [&results, &list_all_properties](const JS::Shape& shape, auto& property_pattern) { Function<void(const JS::Shape&, const StringView&)> list_all_properties = [&results, &list_all_properties](const JS::Shape& shape, auto& property_pattern) {
for (const auto& descriptor : shape.property_table()) { for (const auto& descriptor : shape.property_table()) {
if (descriptor.value.attributes & JS::Attribute::Enumerable) { if (descriptor.key.view().starts_with(property_pattern)) {
if (descriptor.key.view().starts_with(property_pattern)) { Line::CompletionSuggestion completion { descriptor.key };
Line::CompletionSuggestion completion { descriptor.key }; if (!results.contains_slow(completion)) { // hide duplicates
if (!results.contains_slow(completion)) { // hide duplicates results.append(completion);
results.append(completion);
}
} }
} }
} }