File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Userland/Libraries/LibJS/Bytecode Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1625,8 +1625,15 @@ Bytecode::CodeGenerationErrorOr<void> WithStatement::generate_bytecode(Bytecode:
1625
1625
{
1626
1626
TRY (m_object->generate_bytecode (generator));
1627
1627
generator.emit <Bytecode::Op::EnterObjectEnvironment>();
1628
+
1629
+ // EnterObjectEnvironment sets the running execution context's lexical_environment to a new Object Environment.
1630
+ generator.start_boundary (Bytecode::Generator::BlockBoundaryType::LeaveLexicalEnvironment);
1628
1631
TRY (m_body->generate_bytecode (generator));
1629
- generator.emit <Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Lexical);
1632
+ generator.end_boundary (Bytecode::Generator::BlockBoundaryType::LeaveLexicalEnvironment);
1633
+
1634
+ if (!generator.is_current_block_terminated ())
1635
+ generator.emit <Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Lexical);
1636
+
1630
1637
return {};
1631
1638
}
1632
1639
You can’t perform that action at this time.
0 commit comments