mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibJS: Make the StringIndexOf AO public
It will be used outside of String.prototype.
This commit is contained in:
parent
1b4a23095c
commit
a984067567
Notes:
sideshowbarker
2024-07-17 07:25:39 +09:00
Author: https://github.com/trflynn89
Commit: a984067567
Pull-request: https://github.com/SerenityOS/serenity/pull/22557
2 changed files with 2 additions and 1 deletions
|
@ -64,7 +64,7 @@ static Optional<size_t> split_match(Utf16View const& haystack, size_t start, Utf
|
|||
}
|
||||
|
||||
// 6.1.4.1 StringIndexOf ( string, searchValue, fromIndex ), https://tc39.es/ecma262/#sec-stringindexof
|
||||
static Optional<size_t> string_index_of(Utf16View const& string, Utf16View const& search_value, size_t from_index)
|
||||
Optional<size_t> string_index_of(Utf16View const& string, Utf16View const& search_value, size_t from_index)
|
||||
{
|
||||
// 1. Let len be the length of string.
|
||||
size_t string_length = string.length_in_code_units();
|
||||
|
|
|
@ -17,6 +17,7 @@ struct CodePoint {
|
|||
size_t code_unit_count { 0 };
|
||||
};
|
||||
|
||||
Optional<size_t> string_index_of(Utf16View const& string, Utf16View const& search_value, size_t from_index);
|
||||
CodePoint code_point_at(Utf16View const& string, size_t position);
|
||||
static constexpr Utf8View whitespace_characters = Utf8View("\x09\x0A\x0B\x0C\x0D\x20\xC2\xA0\xE1\x9A\x80\xE2\x80\x80\xE2\x80\x81\xE2\x80\x82\xE2\x80\x83\xE2\x80\x84\xE2\x80\x85\xE2\x80\x86\xE2\x80\x87\xE2\x80\x88\xE2\x80\x89\xE2\x80\x8A\xE2\x80\xAF\xE2\x81\x9F\xE3\x80\x80\xE2\x80\xA8\xE2\x80\xA9\xEF\xBB\xBF"sv);
|
||||
ThrowCompletionOr<String> trim_string(VM&, Value string, TrimMode where);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue