Shell: Do not flatten syntactic lists in for_each_entry()

This commit is contained in:
AnotherTest 2020-08-22 13:56:11 +04:30 committed by Andreas Kling
parent 0676bd4afc
commit 2c14abedd6
Notes: sideshowbarker 2024-07-19 03:17:41 +09:00

View File

@ -87,6 +87,16 @@ void Node::for_each_entry(RefPtr<Shell> shell, Function<IterationDecision(RefPtr
callback(value);
return;
}
if (value->is_list_without_resolution()) {
auto list = value->resolve_without_cast(shell);
for (auto& element : static_cast<ListValue*>(list.ptr())->values()) {
if (callback(element) == IterationDecision::Break)
break;
}
return;
}
auto list = value->resolve_as_list(shell);
for (auto& element : list) {
if (callback(create<StringValue>(move(element))) == IterationDecision::Break)