mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-23 08:06:11 +00:00
LibJS: Functions with no variables don't need to create environment
Just hand out the parent environment instead.
This commit is contained in:
@@ -72,7 +72,8 @@ LexicalEnvironment* ScriptFunction::create_environment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (variables.is_empty())
|
||||
return m_parent_environment;
|
||||
return heap().allocate<LexicalEnvironment>(move(variables), m_parent_environment);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user