mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:38:11 +00:00
LibJS: Implement bytecode generation for WithStatement
This commit is contained in:
parent
57386ca839
commit
2000251333
5 changed files with 38 additions and 0 deletions
|
@ -1618,4 +1618,13 @@ Bytecode::CodeGenerationErrorOr<void> AwaitExpression::generate_bytecode(Bytecod
|
|||
return {};
|
||||
}
|
||||
|
||||
Bytecode::CodeGenerationErrorOr<void> WithStatement::generate_bytecode(Bytecode::Generator& generator) const
|
||||
{
|
||||
TRY(m_object->generate_bytecode(generator));
|
||||
generator.emit<Bytecode::Op::EnterObjectEnvironment>();
|
||||
TRY(m_body->generate_bytecode(generator));
|
||||
generator.emit<Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Lexical);
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue