Skip to content

Commit

Permalink
LibJS/Bytecode: Make sure empty with statement results in undefined
Browse files Browse the repository at this point in the history
2 new passes on test262. :^)
  • Loading branch information
awesomekling committed Jul 2, 2023
1 parent 8ba4036 commit 5eb98f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2372,6 +2372,9 @@ Bytecode::CodeGenerationErrorOr<void> WithStatement::generate_bytecode(Bytecode:

// EnterObjectEnvironment sets the running execution context's lexical_environment to a new Object Environment.
generator.start_boundary(Bytecode::Generator::BlockBoundaryType::LeaveLexicalEnvironment);

generator.emit<Bytecode::Op::LoadImmediate>(js_undefined());

TRY(m_body->generate_bytecode(generator));
generator.end_boundary(Bytecode::Generator::BlockBoundaryType::LeaveLexicalEnvironment);

Expand Down

0 comments on commit 5eb98f7

Please sign in to comment.