mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Port DOMException interface from DeprecatedString to String
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 07:06:47 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/41928c2902 Pull-request: https://github.com/SerenityOS/serenity/pull/20968
@@ -44,7 +44,7 @@ WebIDL::ExceptionOr<DeprecatedString> CharacterData::substring_data(size_t offse
|
||||
|
||||
// 2. If offset is greater than length, then throw an "IndexSizeError" DOMException.
|
||||
if (offset > length)
|
||||
return WebIDL::IndexSizeError::create(realm(), "Substring offset out of range.");
|
||||
return WebIDL::IndexSizeError::create(realm(), "Substring offset out of range."_fly_string);
|
||||
|
||||
// 3. If offset plus count is greater than length, return a string whose value is the code units from the offsetth code unit
|
||||
// to the end of node’s data, and then return.
|
||||
@@ -63,7 +63,7 @@ WebIDL::ExceptionOr<void> CharacterData::replace_data(size_t offset, size_t coun
|
||||
|
||||
// 2. If offset is greater than length, then throw an "IndexSizeError" DOMException.
|
||||
if (offset > length)
|
||||
return WebIDL::IndexSizeError::create(realm(), "Replacement offset out of range.");
|
||||
return WebIDL::IndexSizeError::create(realm(), "Replacement offset out of range."_fly_string);
|
||||
|
||||
// 3. If offset plus count is greater than length, then set count to length minus offset.
|
||||
if (offset + count > length)
|
||||
|
||||
Reference in New Issue
Block a user