mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Make DOMException take error message as a String
There was no need to use FlyString for error messages, and it just caused a bunch of churn since these strings typically only existed during the lifetime of the error.
This commit is contained in:
parent
5f9a36feac
commit
175f3febb8
Notes:
github-actions[bot]
2024-10-12 19:15:13 +00:00
Author: https://github.com/awesomekling
Commit: 175f3febb8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1743
Reviewed-by: https://github.com/ADKaster
89 changed files with 464 additions and 462 deletions
|
@ -115,7 +115,7 @@ WebIDL::ExceptionOr<String> WindowOrWorkerGlobalScopeMixin::btoa(String const& d
|
|||
byte_string.ensure_capacity(data.bytes().size());
|
||||
for (u32 code_point : Utf8View(data)) {
|
||||
if (code_point > 0xff)
|
||||
return WebIDL::InvalidCharacterError::create(realm, "Data contains characters outside the range U+0000 and U+00FF"_fly_string);
|
||||
return WebIDL::InvalidCharacterError::create(realm, "Data contains characters outside the range U+0000 and U+00FF"_string);
|
||||
byte_string.append(code_point);
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ WebIDL::ExceptionOr<String> WindowOrWorkerGlobalScopeMixin::atob(String const& d
|
|||
|
||||
// 2. If decodedData is failure, then throw an "InvalidCharacterError" DOMException.
|
||||
if (decoded_data.is_error())
|
||||
return WebIDL::InvalidCharacterError::create(realm, "Input string is not valid base64 data"_fly_string);
|
||||
return WebIDL::InvalidCharacterError::create(realm, "Input string is not valid base64 data"_string);
|
||||
|
||||
// 3. Return decodedData.
|
||||
// decode_base64() returns a byte buffer. LibJS uses UTF-8 for strings. Use Latin1Decoder to convert bytes 128-255 to UTF-8.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue