mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibJS+Everywhere: Remove VM::exception() and most related functions
This commit removes all exception related code: Remove VM::exception(), VM::throw_exception() etc. Any leftover throw_exception calls are moved to throw_completion. The one method left is clear_exception() which is now a no-op. Most of these calls are just to clear whatever exception might have been thrown when handling a Completion. So to have a cleaner commit this will be removed in a next commit. It also removes the actual Exception and TemporaryClearException classes since these are no longer used. In any spot where the exception was actually used an attempt was made to preserve that behavior. However since it is no longer tracked by the VM we cannot access exceptions which were thrown in previous calls. There are two such cases which might have different behavior: - In Web::DOM::Document::interpreter() the on_call_stack_emptied hook used to print any uncaught exception but this is now no longer possible as the VM does not store uncaught exceptions. - In js the code used to be interruptable by throwing an exception on the VM. This is no longer possible but was already somewhat fragile before as you could happen to throw an exception just before a VERIFY.
This commit is contained in:
parent
4ef1e8f226
commit
9264f9d24e
Notes:
sideshowbarker
2024-07-17 19:37:58 +09:00
Author: https://github.com/davidot
Commit: 9264f9d24e
Pull-request: https://github.com/SerenityOS/serenity/pull/12343
Reviewed-by: https://github.com/linusg
35 changed files with 145 additions and 349 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <LibCore/ElapsedTimer.h>
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibWeb/HTML/Scripting/ClassicScript.h>
|
||||
#include <LibWeb/HTML/Scripting/ExceptionReporter.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
|
@ -81,7 +82,7 @@ JS::Value ClassicScript::run(RethrowErrors rethrow_errors)
|
|||
dbgln_if(HTML_SCRIPT_DEBUG, "ClassicScript: Finished running script {}, Duration: {}ms", filename(), timer.elapsed());
|
||||
if (evaluation_status.is_error()) {
|
||||
// FIXME: Propagate error according to the spec.
|
||||
interpreter->vm().clear_exception();
|
||||
report_exception(evaluation_status);
|
||||
return {};
|
||||
}
|
||||
return evaluation_status.value();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue