mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
LibWeb: Support plain (throw) JS::Completion in WebIDL::ExceptionOr
This makes it possible to propagate exceptions from a function that returns JS::ThrowCompletionOr via TRY() in another function that returns WebIDL::ExceptionOr.
This commit is contained in:
parent
b9d626d6b2
commit
4461234898
2 changed files with 20 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
* Copyright (c) 2021-2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -75,6 +75,9 @@ ALWAYS_INLINE JS::Completion dom_exception_to_throw_completion(auto&& vm, auto&&
|
|||
},
|
||||
[&](JS::NonnullGCPtr<WebIDL::DOMException> const& exception) {
|
||||
return throw_completion(exception);
|
||||
},
|
||||
[&](JS::Completion const& completion) {
|
||||
return completion;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue