mirror of
https://github.com/zebrajr/ladybird.git
synced 2026-01-15 12:15:15 +00:00
LibWeb: Support implicit downcast to DOMException in ExceptionOr
This commit is contained in:
committed by
Shannon Booth
parent
cbd07b2153
commit
c12f21498c
@@ -9,6 +9,7 @@
|
||||
#include <LibWeb/Bindings/DOMPointReadOnlyPrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Geometry/DOMMatrix.h>
|
||||
#include <LibWeb/Geometry/DOMPoint.h>
|
||||
#include <LibWeb/Geometry/DOMPointReadOnly.h>
|
||||
#include <LibWeb/HTML/StructuredSerialize.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
@@ -91,6 +91,13 @@ public:
|
||||
ExceptionOr(ExceptionOr const& other) = default;
|
||||
~ExceptionOr() = default;
|
||||
|
||||
template<typename E>
|
||||
requires(IsBaseOf<DOMException, E>)
|
||||
ExceptionOr(GC::Ref<E> exception)
|
||||
: ExceptionOr(GC::Ref<DOMException> { exception })
|
||||
{
|
||||
}
|
||||
|
||||
ValueType& value()
|
||||
requires(!IsSame<ValueType, Empty>)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user