LibWeb: Don't propogate small OOMs from URLSearchParams

Made easier now that URL percent encode after encoding is also not
throwing any errors. This simplfies a bunch of error handling.
This commit is contained in:
Shannon Booth 2024-08-11 00:24:54 +12:00 committed by Tim Ledbetter
commit df4739d7ce
Notes: github-actions[bot] 2024-08-12 22:02:35 +00:00
7 changed files with 59 additions and 77 deletions

View file

@ -149,11 +149,10 @@ WebIDL::ExceptionOr<JS::Value> package_data(JS::Realm& realm, ByteBuffer bytes,
auto entries = DOMURL::url_decode(StringView { bytes });
// 2. If entries is failure, then throw a TypeError.
if (entries.is_error())
return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, entries.error().string_literal() };
// FIXME: Spec bug? It doesn't seem possible to throw an error here.
// 3. Return a new FormData object whose entry list is entries.
return TRY(XHR::FormData::create(realm, entries.release_value()));
return TRY(XHR::FormData::create(realm, entries));
}
// Otherwise, throw a TypeError.
else {