mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 06:34:58 +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:
parent
ed80952cb6
commit
54c95d44ce
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue