diff options
author | Linus Groh <mail@linusgroh.de> | 2021-04-13 00:58:54 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-13 15:40:52 +0200 |
commit | f2abe42ecb9341a9981900d4330f92217fc4b9f0 (patch) | |
tree | 85b5c4e97913de2b47cd4a2772bf1cd28e507828 /Userland/Libraries/LibJS/AST.cpp | |
parent | 7cbede4342cb0b9ea085e9b213014fb43582443d (diff) | |
download | serenity-f2abe42ecb9341a9981900d4330f92217fc4b9f0.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibJS/AST.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/AST.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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 |