diff options
Diffstat (limited to 'Libraries/LibWeb')
-rw-r--r-- | Libraries/LibWeb/DOM/Document.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 7191b42a68..0a762d6200 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -436,7 +436,11 @@ JS::Value Document::run_javascript(const StringView& source) parser.print_errors(); return JS::js_undefined(); } - return document().interpreter().run(document().interpreter().global_object(), *program); + auto& interpreter = document().interpreter(); + auto result = interpreter.run(interpreter.global_object(), *program); + if (interpreter.exception()) + interpreter.clear_exception(); + return result; } NonnullRefPtr<Element> Document::create_element(const String& tag_name) |