mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:57:44 +00:00
LibWeb/WebIDL: Store SimpleException message as a String{,View} variant
This commit is contained in:
parent
1032ac2453
commit
11b40dbcf5
8 changed files with 28 additions and 24 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue