mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibJS: Implement bytecode generation for WithStatement
This commit is contained in:
parent
57386ca839
commit
2000251333
Notes:
sideshowbarker
2024-07-17 17:29:53 +09:00
Author: https://github.com/alimpfard
Commit: 2000251333
Pull-request: https://github.com/SerenityOS/serenity/pull/13026
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