mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
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.
This commit is contained in:
@@ -127,7 +127,10 @@ void Node::dispatch_event(NonnullRefPtr<Event> event)
|
||||
auto* event_wrapper = wrap(global_object, *event);
|
||||
JS::MarkedValueList arguments(global_object.heap());
|
||||
arguments.append(event_wrapper);
|
||||
document().interpreter().call(function, this_value, move(arguments));
|
||||
auto& interpreter = document().interpreter();
|
||||
(void)interpreter.call(function, this_value, move(arguments));
|
||||
if (interpreter.exception())
|
||||
interpreter.clear_exception();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user