1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

LibJS: Don't call shrink_to_fit() on same environment twice in FDI

This commit is contained in:
Andreas Kling 2023-11-27 20:22:20 +01:00
parent 3fc0333ee6
commit 3b6785245f

View file

@ -914,7 +914,7 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
if (is<DeclarativeEnvironment>(*lex_environment))
static_cast<DeclarativeEnvironment*>(lex_environment.ptr())->shrink_to_fit();
if (is<DeclarativeEnvironment>(*var_environment))
if (lex_environment != var_environment && is<DeclarativeEnvironment>(*var_environment))
static_cast<DeclarativeEnvironment*>(var_environment.ptr())->shrink_to_fit();
// 37. Return unused.