mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:47:35 +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
|
@ -118,7 +118,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<URLSearchParams>> URLSearchParams::construc
|
|||
for (auto const& pair : init_sequence) {
|
||||
// a. If pair does not contain exactly two items, then throw a TypeError.
|
||||
if (pair.size() != 2)
|
||||
return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, DeprecatedString::formatted("Expected only 2 items in pair, got {}", pair.size()) };
|
||||
return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, TRY_OR_THROW_OOM(vm, String::formatted("Expected only 2 items in pair, got {}", pair.size())) };
|
||||
|
||||
// b. Append a new name-value pair whose name is pair’s first item, and value is pair’s second item, to query’s list.
|
||||
list.append(QueryParam { .name = pair[0], .value = pair[1] });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue