From f2abe42ecb9341a9981900d4330f92217fc4b9f0 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 13 Apr 2021 00:58:54 +0200 Subject: [PATCH] LibJS: Update empty TryStatement result value to undefined It's what the spec wants us to do, although I'm not sure if it has an observable effect anywhere, as we don't expose empty values. Let's do it anyway. --- Userland/Libraries/LibJS/AST.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 721a24b047..65b28af165 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -2013,7 +2013,7 @@ Value TryStatement::execute(Interpreter& interpreter, GlobalObject& global_objec } } - return result; + return result.value_or(js_undefined()); } Value CatchClause::execute(Interpreter& interpreter, GlobalObject&) const