diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-14 17:31:07 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-14 17:31:07 +0200 |
commit | bbe2d4a2d97ce7968b0985e4f99cdfc01fe5823e (patch) | |
tree | ee26f6da1865c600da92c961982f3f06794e45ee /Libraries/LibWeb/DOM/XMLHttpRequest.cpp | |
parent | c5127389caeab57f1f90d722350f691b0365a5fc (diff) | |
download | serenity-bbe2d4a2d97ce7968b0985e4f99cdfc01fe5823e.zip |
LibJS+LibWeb: Clear exceptions after call'ing JavaScript functions
Decorated Interpreter::call() with [[nodiscard]] to provoke thinking
about the returned value at each call site. This is definitely not
perfect and we should really start thinking about slimming down the
public-facing LibJS interpreter API.
Fixes #3136.
Diffstat (limited to 'Libraries/LibWeb/DOM/XMLHttpRequest.cpp')
-rw-r--r-- | Libraries/LibWeb/DOM/XMLHttpRequest.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Libraries/LibWeb/DOM/XMLHttpRequest.cpp b/Libraries/LibWeb/DOM/XMLHttpRequest.cpp index 6dcf43dde7..b75d272701 100644 --- a/Libraries/LibWeb/DOM/XMLHttpRequest.cpp +++ b/Libraries/LibWeb/DOM/XMLHttpRequest.cpp @@ -98,7 +98,10 @@ void XMLHttpRequest::dispatch_event(NonnullRefPtr<DOM::Event> event) auto* this_value = wrap(global_object, *this); JS::MarkedValueList arguments(global_object.heap()); arguments.append(wrap(global_object, *event)); - function.interpreter().call(function, this_value, move(arguments)); + auto& interpreter = function.interpreter(); + (void)interpreter.call(function, this_value, move(arguments)); + if (interpreter.exception()) + interpreter.clear_exception(); } } } |