1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:57:44 +00:00

LibJS: Move the current exception from Interpreter to VM

This will allow us to throw exceptions even when there is no active
interpreter in the VM.
This commit is contained in:
Andreas Kling 2020-09-21 15:28:09 +02:00
parent 675b482fe7
commit 4a8bfcdd1c
12 changed files with 26 additions and 23 deletions

View file

@ -363,7 +363,7 @@ JSFileResult TestRunner::run_file_test(const String& test_path)
auto& before_initial_page_load = new_interpreter.get_variable("__BeforeInitialPageLoad__", new_interpreter.global_object()).as_function();
(void)new_interpreter.call(before_initial_page_load, JS::js_undefined());
if (new_interpreter.exception())
new_interpreter.clear_exception();
new_interpreter.vm().clear_exception();
// Now parse the HTML page.
parser.run(page_to_load);
@ -373,7 +373,7 @@ JSFileResult TestRunner::run_file_test(const String& test_path)
auto& after_initial_page_load = new_interpreter.get_variable("__AfterInitialPageLoad__", new_interpreter.global_object()).as_function();
(void)new_interpreter.call(after_initial_page_load, JS::js_undefined());
if (new_interpreter.exception())
new_interpreter.clear_exception();
new_interpreter.vm().clear_exception();
auto test_json = get_test_results(new_interpreter);
if (!test_json.has_value()) {