mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +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
Notes:
sideshowbarker
2024-07-19 07:33:54 +09:00
Author: https://github.com/awesomekling
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);
|
return heap().allocate<LexicalEnvironment>(move(variables), m_parent_environment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue