diff options
author | Linus Groh <mail@linusgroh.de> | 2023-03-03 18:04:58 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-03-03 19:50:36 +0000 |
commit | 11b40dbcf5f19971aa601099c1be26a77b8194eb (patch) | |
tree | 31a7f0bac699e7e2fca6c1570013148a7b024452 /Userland/Libraries/LibWeb/Bindings | |
parent | 1032ac2453e7c276152db1a5c9f9a55b377d7419 (diff) | |
download | serenity-11b40dbcf5f19971aa601099c1be26a77b8194eb.zip |
LibWeb/WebIDL: Store SimpleException message as a String{,View} variant
Diffstat (limited to 'Userland/Libraries/LibWeb/Bindings')
-rw-r--r-- | Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h b/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h index 60935a0dc6..ab0b4879e8 100644 --- a/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h +++ b/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, the SerenityOS developers. + * Copyright (c) 2021-2023, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -60,10 +60,11 @@ ALWAYS_INLINE JS::Completion dom_exception_to_throw_completion(JS::VM& vm, auto& { return exception.visit( [&](WebIDL::SimpleException const& exception) { + auto message = exception.message.visit([](auto const& s) -> StringView { return s; }); switch (exception.type) { #define E(x) \ case WebIDL::SimpleExceptionType::x: \ - return vm.template throw_completion<JS::x>(exception.message); + return vm.template throw_completion<JS::x>(message); ENUMERATE_SIMPLE_WEBIDL_EXCEPTION_TYPES(E) |