diff options
author | davidot <davidot@serenityos.org> | 2022-02-07 15:12:41 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-02-08 09:12:42 +0000 |
commit | 9264f9d24e10c3ca8d522450bc9152e69cbd6cda (patch) | |
tree | 68ad59cc9fb5328c8925e6f790c2da805dadbbe0 /Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp | |
parent | 4ef1e8f226caff2a0d9002cb5e30fbd7bc99b7b3 (diff) | |
download | serenity-9264f9d24e10c3ca8d522450bc9152e69cbd6cda.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp b/Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp index ea21bd2b55..d1fbbae63f 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp @@ -70,7 +70,7 @@ ThrowCompletionOr<Value> PromiseReactionJob::call() // f. If promiseCapability is undefined, then if (!promise_capability.has_value()) { // i. Assert: handlerResult is not an abrupt completion. - VERIFY(!vm.exception()); + VERIFY(!handler_result.is_abrupt()); // ii. Return NormalCompletion(empty). dbgln_if(PROMISE_DEBUG, "[PromiseReactionJob @ {}]: Reaction has no PromiseCapability, returning empty value", this); |