diff options
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r-- | Userland/Libraries/LibJS/Lexer.h | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/MarkupGenerator.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/MarkupGenerator.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Parser.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Parser.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Utf16String.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Utf16String.h | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Token.h | 8 |
10 files changed, 17 insertions, 17 deletions
diff --git a/Userland/Libraries/LibJS/Lexer.h b/Userland/Libraries/LibJS/Lexer.h index ee151a5753..6f5e3cbdb5 100644 --- a/Userland/Libraries/LibJS/Lexer.h +++ b/Userland/Libraries/LibJS/Lexer.h @@ -20,8 +20,8 @@ public: Token next(); - const StringView& source() const { return m_source; }; - const StringView& filename() const { return m_filename; }; + StringView source() const { return m_source; }; + StringView filename() const { return m_filename; }; void disallow_html_comments() { m_allow_html_comments = false; }; diff --git a/Userland/Libraries/LibJS/MarkupGenerator.cpp b/Userland/Libraries/LibJS/MarkupGenerator.cpp index ff82823b00..616de9a860 100644 --- a/Userland/Libraries/LibJS/MarkupGenerator.cpp +++ b/Userland/Libraries/LibJS/MarkupGenerator.cpp @@ -17,7 +17,7 @@ namespace JS { -String MarkupGenerator::html_from_source(const StringView& source) +String MarkupGenerator::html_from_source(StringView source) { StringBuilder builder; auto lexer = Lexer(source); diff --git a/Userland/Libraries/LibJS/MarkupGenerator.h b/Userland/Libraries/LibJS/MarkupGenerator.h index a6070c15b5..97940d64cb 100644 --- a/Userland/Libraries/LibJS/MarkupGenerator.h +++ b/Userland/Libraries/LibJS/MarkupGenerator.h @@ -14,7 +14,7 @@ namespace JS { class MarkupGenerator { public: - static String html_from_source(const StringView&); + static String html_from_source(StringView); static String html_from_value(Value); static String html_from_error(Object&); diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp index 80c47e7fa6..fbe1312cc2 100644 --- a/Userland/Libraries/LibJS/Parser.cpp +++ b/Userland/Libraries/LibJS/Parser.cpp @@ -609,7 +609,7 @@ static constexpr AK::Array<StringView, 9> strict_reserved_words = { "implements" static bool is_strict_reserved_word(StringView str) { - return any_of(strict_reserved_words, [&str](StringView const& word) { + return any_of(strict_reserved_words, [&str](StringView word) { return word == str; }); } @@ -3575,7 +3575,7 @@ Token Parser::consume(TokenType expected_type) Token Parser::consume_and_validate_numeric_literal() { - auto is_unprefixed_octal_number = [](const StringView& value) { + auto is_unprefixed_octal_number = [](StringView value) { return value.length() > 1 && value[0] == '0' && is_ascii_digit(value[1]); }; auto literal_start = position(); diff --git a/Userland/Libraries/LibJS/Parser.h b/Userland/Libraries/LibJS/Parser.h index 42c52ea939..b40649306b 100644 --- a/Userland/Libraries/LibJS/Parser.h +++ b/Userland/Libraries/LibJS/Parser.h @@ -130,7 +130,7 @@ public: return String::formatted("{} (line: {}, column: {})", message, position.value().line, position.value().column); } - String source_location_hint(const StringView& source, const char spacer = ' ', const char indicator = '^') const + String source_location_hint(StringView source, const char spacer = ' ', const char indicator = '^') const { if (!position.has_value()) return {}; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp index 5e14a77690..119bfe86ff 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp @@ -266,7 +266,7 @@ ThrowCompletionOr<Vector<String>> canonicalize_locale_list(GlobalObject& global_ } // 9.2.2 BestAvailableLocale ( availableLocales, locale ), https://tc39.es/ecma402/#sec-bestavailablelocale -Optional<String> best_available_locale(StringView const& locale) +Optional<String> best_available_locale(StringView locale) { // 1. Let candidate be locale. StringView candidate = locale; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h index 16e5391053..a2f15493ab 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h @@ -39,7 +39,7 @@ String canonicalize_unicode_locale_id(Unicode::LocaleID& locale); bool is_well_formed_currency_code(StringView currency); bool is_well_formed_unit_identifier(StringView unit_identifier); ThrowCompletionOr<Vector<String>> canonicalize_locale_list(GlobalObject&, Value locales); -Optional<String> best_available_locale(StringView const& locale); +Optional<String> best_available_locale(StringView locale); String insert_unicode_extension_and_canonicalize(Unicode::LocaleID locale_id, Unicode::LocaleExtension extension); LocaleResult resolve_locale(Vector<String> const& requested_locales, LocaleOptions const& options, Vector<StringView> const& relevant_extension_keys); Vector<String> lookup_supported_locales(Vector<String> const& requested_locales); diff --git a/Userland/Libraries/LibJS/Runtime/Utf16String.cpp b/Userland/Libraries/LibJS/Runtime/Utf16String.cpp index e5ad11e822..c1d98c1b5f 100644 --- a/Userland/Libraries/LibJS/Runtime/Utf16String.cpp +++ b/Userland/Libraries/LibJS/Runtime/Utf16String.cpp @@ -32,7 +32,7 @@ NonnullRefPtr<Utf16StringImpl> Utf16StringImpl::create(Vector<u16, 1> string) return adopt_ref(*new Utf16StringImpl(move(string))); } -NonnullRefPtr<Utf16StringImpl> Utf16StringImpl::create(StringView const& string) +NonnullRefPtr<Utf16StringImpl> Utf16StringImpl::create(StringView string) { return create(AK::utf8_to_utf16(string)); } @@ -67,7 +67,7 @@ Utf16String::Utf16String(Vector<u16, 1> string) { } -Utf16String::Utf16String(StringView const& string) +Utf16String::Utf16String(StringView string) : m_string(Detail::Utf16StringImpl::create(move(string))) { } diff --git a/Userland/Libraries/LibJS/Runtime/Utf16String.h b/Userland/Libraries/LibJS/Runtime/Utf16String.h index e38e5b4592..84d3afc364 100644 --- a/Userland/Libraries/LibJS/Runtime/Utf16String.h +++ b/Userland/Libraries/LibJS/Runtime/Utf16String.h @@ -21,7 +21,7 @@ public: static NonnullRefPtr<Utf16StringImpl> create(); static NonnullRefPtr<Utf16StringImpl> create(Vector<u16, 1>); - static NonnullRefPtr<Utf16StringImpl> create(StringView const&); + static NonnullRefPtr<Utf16StringImpl> create(StringView); static NonnullRefPtr<Utf16StringImpl> create(Utf16View const&); Vector<u16, 1> const& string() const; @@ -40,7 +40,7 @@ class Utf16String { public: Utf16String(); explicit Utf16String(Vector<u16, 1>); - explicit Utf16String(StringView const&); + explicit Utf16String(StringView); explicit Utf16String(Utf16View const&); Vector<u16, 1> const& string() const; diff --git a/Userland/Libraries/LibJS/Token.h b/Userland/Libraries/LibJS/Token.h index 36c2e048e8..cbdfda602f 100644 --- a/Userland/Libraries/LibJS/Token.h +++ b/Userland/Libraries/LibJS/Token.h @@ -201,16 +201,16 @@ public: static const char* name(TokenType); const String& message() const { return m_message; } - const StringView& trivia() const { return m_trivia; } - const StringView& original_value() const { return m_original_value; } + StringView trivia() const { return m_trivia; } + StringView original_value() const { return m_original_value; } StringView value() const { return m_value.visit( - [](StringView const& view) { return view; }, + [](StringView view) { return view; }, [](FlyString const& identifier) { return identifier.view(); }, [](Empty) -> StringView { VERIFY_NOT_REACHED(); }); } - const StringView& filename() const { return m_filename; } + StringView filename() const { return m_filename; } size_t line_number() const { return m_line_number; } size_t line_column() const { return m_line_column; } size_t offset() const { return m_offset; } |