mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 19:59:17 +00:00
Shell: Search for variables in the last frame first
Otherwise, we'll end up overwriting another frame's variables if the names match up.
This commit is contained in:
committed by
Andreas Kling
parent
bedad383b5
commit
e87e580eb3
@@ -359,7 +359,8 @@ String Shell::resolve_path(String path) const
|
||||
|
||||
Shell::LocalFrame* Shell::find_frame_containing_local_variable(const String& name)
|
||||
{
|
||||
for (auto& frame : m_local_frames) {
|
||||
for (size_t i = m_local_frames.size(); i > 0; --i) {
|
||||
auto& frame = m_local_frames[i - 1];
|
||||
if (frame.local_variables.contains(name))
|
||||
return &frame;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user