ソースを参照

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.
Linus Groh 4 年 前
コミット
f2abe42ecb
1 ファイル変更1 行追加1 行削除
  1. 1 1
      Userland/Libraries/LibJS/AST.cpp

+ 1 - 1
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
 Value CatchClause::execute(Interpreter& interpreter, GlobalObject&) const