From 98897ff6769d8858a4ddc40c21e5ae53c71b301a Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Tue, 8 Jun 2021 03:58:23 +0300 Subject: [PATCH] LibJS: Return the last value from a with statement --- Userland/Libraries/LibJS/AST.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index fdf5fd651f..8ce026096b 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -302,8 +302,7 @@ Value WithStatement::execute(Interpreter& interpreter, GlobalObject& global_obje auto* with_scope = interpreter.heap().allocate(global_object, *object, interpreter.vm().call_frame().scope); TemporaryChange scope_change(interpreter.vm().call_frame().scope, with_scope); - interpreter.execute_statement(global_object, m_body); - return {}; + return interpreter.execute_statement(global_object, m_body); } Value WhileStatement::execute(Interpreter& interpreter, GlobalObject& global_object) const