Browse Source

Don't create parameter expressions environment if not used

optimization/fast-local-variables
Haled Odat 7 months ago
parent
commit
d53a0c4e9f
  1. 7
      boa_engine/src/bytecompiler/declarations.rs

7
boa_engine/src/bytecompiler/declarations.rs

@ -932,8 +932,11 @@ impl ByteCompiler<'_, '_> {
// c. Let env be NewDeclarativeEnvironment(calleeEnv).
// d. Assert: The VariableEnvironment of calleeContext is calleeEnv.
// e. Set the LexicalEnvironment of calleeContext to env.
let _ = self.push_compile_environment(false);
additional_env = true;
if self.can_optimize_local_variables {
let _ = self.push_compile_environment(false);
additional_env = true;
}
}
// 22. If argumentsObjectNeeded is true, then

Loading…
Cancel
Save