diff options
-rw-r--r-- | Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp index 48a8633f9b..526b7a1b76 100644 --- a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp +++ b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp @@ -21,10 +21,11 @@ Optional<Bytecode::Register> ASTNode::generate_bytecode(Bytecode::Generator&) co Optional<Bytecode::Register> ScopeNode::generate_bytecode(Bytecode::Generator& generator) const { generator.emit<Bytecode::Op::EnterScope>(*this); + Optional<Bytecode::Register> last_value_reg; for (auto& child : children()) { - [[maybe_unused]] auto reg = child.generate_bytecode(generator); + last_value_reg = child.generate_bytecode(generator); } - return {}; + return last_value_reg; } Optional<Bytecode::Register> EmptyStatement::generate_bytecode(Bytecode::Generator&) const |