From 4802413f71fb0501276e7e4639a75710a8eca6bc Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 26 Mar 2020 12:36:52 +0100 Subject: [PATCH] LibJS: Say "return {}" instead of "return js_undefined()" in AST nodes This looks a bit nicer somehow. --- Libraries/LibJS/AST.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/LibJS/AST.cpp b/Libraries/LibJS/AST.cpp index c451014084..b2c1802a38 100644 --- a/Libraries/LibJS/AST.cpp +++ b/Libraries/LibJS/AST.cpp @@ -109,7 +109,7 @@ Value IfStatement::execute(Interpreter& interpreter) const if (m_alternate) return interpreter.run(*m_alternate); - return js_undefined(); + return {}; } Value WhileStatement::execute(Interpreter& interpreter) const @@ -616,7 +616,7 @@ Value VariableDeclaration::execute(Interpreter& interpreter) const interpreter.set_variable(name().string(), initalizer_result, true); } - return js_undefined(); + return {}; } void VariableDeclaration::dump(int indent) const @@ -707,7 +707,7 @@ Value BooleanLiteral::execute(Interpreter&) const Value UndefinedLiteral::execute(Interpreter&) const { - return js_undefined(); + return {}; } Value NullLiteral::execute(Interpreter&) const