mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +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:
parent
628777f94a
commit
ce0bed0482
Notes:
sideshowbarker
2024-07-19 07:02:34 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/ce0bed04827 Pull-request: https://github.com/SerenityOS/serenity/pull/2063
1 changed files with 4 additions and 6 deletions
|
@ -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) {
|
||||
for (const auto& descriptor : shape.property_table()) {
|
||||
if (descriptor.value.attributes & JS::Attribute::Enumerable) {
|
||||
if (descriptor.key.view().starts_with(property_pattern)) {
|
||||
Line::CompletionSuggestion completion { descriptor.key };
|
||||
if (!results.contains_slow(completion)) { // hide duplicates
|
||||
results.append(completion);
|
||||
}
|
||||
if (descriptor.key.view().starts_with(property_pattern)) {
|
||||
Line::CompletionSuggestion completion { descriptor.key };
|
||||
if (!results.contains_slow(completion)) { // hide duplicates
|
||||
results.append(completion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue