From c4f0f1cc057f64eaff22680b48d9f24a7289085b Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 4 Jan 2022 22:45:58 +0100 Subject: [PATCH] LibTest: Remove uses of TRY_OR_DISCARD() from JavaScriptTestRunner In one case we can replace it with MUST() and accept the crash (we also VERIFY() that there wasn't an exception); in the other case we don't need to return after a throw completion. --- Userland/Libraries/LibTest/JavaScriptTestRunner.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibTest/JavaScriptTestRunner.h b/Userland/Libraries/LibTest/JavaScriptTestRunner.h index f9eea8fdb0..96855170d4 100644 --- a/Userland/Libraries/LibTest/JavaScriptTestRunner.h +++ b/Userland/Libraries/LibTest/JavaScriptTestRunner.h @@ -336,7 +336,7 @@ inline JSFileResult TestRunner::run_file_test(const String& test_path) if (JS::Bytecode::g_dump_bytecode) executable.dump(); JS::Bytecode::Interpreter bytecode_interpreter(interpreter->global_object(), interpreter->realm()); - TRY_OR_DISCARD(bytecode_interpreter.run(executable)); + MUST(bytecode_interpreter.run(executable)); } else { interpreter->run(interpreter->global_object(), m_test_script->parse_node()); } @@ -352,7 +352,7 @@ inline JSFileResult TestRunner::run_file_test(const String& test_path) if (JS::Bytecode::g_dump_bytecode) executable.dump(); JS::Bytecode::Interpreter bytecode_interpreter(interpreter->global_object(), interpreter->realm()); - TRY_OR_DISCARD(bytecode_interpreter.run(executable)); + (void)bytecode_interpreter.run(executable); } else { interpreter->run(interpreter->global_object(), file_script.value()->parse_node()); }