From 19f88f96dc131f4de0b29e0ddd89323fad144263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Wed, 9 Apr 2025 17:02:30 +0000 Subject: [PATCH] Everywhere: Fix typos - act III --- Libraries/LibCore/EventLoopImplementationUnix.cpp | 2 +- Libraries/LibCore/File.cpp | 2 +- Libraries/LibGfx/ImageFormats/TIFFLoader.cpp | 2 +- Libraries/LibJS/Parser.cpp | 2 +- Libraries/LibJS/Runtime/Completion.cpp | 2 +- Libraries/LibJS/Runtime/Date.cpp | 2 +- Libraries/LibJS/SourceCode.cpp | 4 ++-- .../AsyncGenerator/AsyncGenerator.prototype.next.js | 6 +++--- Libraries/LibJS/Tests/using-declaration.js | 4 ++-- Libraries/LibMedia/FFmpeg/FFmpegVideoDecoder.cpp | 2 +- Libraries/LibUnicode/DateTimeFormat.cpp | 2 +- Libraries/LibWasm/Parser/Parser.cpp | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Libraries/LibCore/EventLoopImplementationUnix.cpp b/Libraries/LibCore/EventLoopImplementationUnix.cpp index b5f28114a6a..a226a83c5d8 100644 --- a/Libraries/LibCore/EventLoopImplementationUnix.cpp +++ b/Libraries/LibCore/EventLoopImplementationUnix.cpp @@ -418,7 +418,7 @@ try_select_again: if (error_or_marked_fd_count.value() != 0) { // Handle file system notifiers by making them normal events. for (size_t i = 1; i < thread_data.poll_fds.size(); ++i) { - // FIXME: Make the check work under Android, pehaps use ALooper + // FIXME: Make the check work under Android, perhaps use ALooper #ifdef AK_OS_ANDROID auto& notifier = *thread_data.notifier_by_index[i]; ThreadEventQueue::current().post_event(notifier, make(notifier.fd(), notifier.type())); diff --git a/Libraries/LibCore/File.cpp b/Libraries/LibCore/File.cpp index a2f26cf7eb0..6192040ab9b 100644 --- a/Libraries/LibCore/File.cpp +++ b/Libraries/LibCore/File.cpp @@ -99,7 +99,7 @@ int File::open_mode_to_options(OpenMode mode) } // Some open modes, like `ReadWrite` imply the ability to create the file if it doesn't exist. - // Certain applications may not want this privledge, and for compability reasons, this is + // Certain applications may not want this privilege, and for compatibility reasons, this is // the easiest way to add this option. if (has_flag(mode, OpenMode::DontCreate)) flags &= ~O_CREAT; diff --git a/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp b/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp index 693502877ef..1abfd7d0cbe 100644 --- a/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp +++ b/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp @@ -487,7 +487,7 @@ private: // - With a BigEndian stream and an EarlyChange of 1, this is used in the PDF format // The fun begins when they decided to change from the former to the latter when moving // from TIFF 5.0 to 6.0, and without including a way for files to be identified. - // Fortunately, as the first byte of a LZW stream is a constant we can guess the endianess + // Fortunately, as the first byte of a LZW stream is a constant we can guess the endianness // and deduce the version from it. The first code is 0x100 (9-bits). if (encoded_bytes[0] == 0x00) decoded_bytes = TRY(Compress::LzwDecompressor::decompress_all(encoded_bytes, 8, 0)); diff --git a/Libraries/LibJS/Parser.cpp b/Libraries/LibJS/Parser.cpp index 8a12b60195c..3c6b71862d5 100644 --- a/Libraries/LibJS/Parser.cpp +++ b/Libraries/LibJS/Parser.cpp @@ -328,7 +328,7 @@ public: } if (m_type == ScopeType::Function && m_bound_names.contains(identifier_group_name)) { - // NOTE: Currently parser can't determine that named function expression assigment creates scope with binding for funciton name so function names are not considered as candidates to be optmized in global variables access + // NOTE: Currently parser can't determine that named function expression assignment creates scope with binding for function name so function names are not considered as candidates to be optimized in global variables access identifier_group.might_be_variable_in_lexical_scope_in_named_function_assignment = true; } diff --git a/Libraries/LibJS/Runtime/Completion.cpp b/Libraries/LibJS/Runtime/Completion.cpp index 9f9674eb5ed..117fed983d7 100644 --- a/Libraries/LibJS/Runtime/Completion.cpp +++ b/Libraries/LibJS/Runtime/Completion.cpp @@ -98,7 +98,7 @@ ThrowCompletionOr await(VM& vm, Value value) promise->perform_then(on_fulfilled, on_rejected, {}); // FIXME: Since we don't support context suspension, we attempt to "wait" for the promise to resolve - // by syncronously running all queued promise jobs. + // by synchronously running all queued promise jobs. if (auto* agent = vm.agent()) { // Embedder case (i.e. LibWeb). Runs all promise jobs by performing a microtask checkpoint. agent->spin_event_loop_until(GC::create_function(vm.heap(), [success] { diff --git a/Libraries/LibJS/Runtime/Date.cpp b/Libraries/LibJS/Runtime/Date.cpp index 82dc6790847..ecb0009d6fc 100644 --- a/Libraries/LibJS/Runtime/Date.cpp +++ b/Libraries/LibJS/Runtime/Date.cpp @@ -385,7 +385,7 @@ static i64 clip_double_to_sane_time(double value) static constexpr auto min_double = static_cast(NumericLimits::min()); static constexpr auto max_double = static_cast(NumericLimits::max()); - // The provided epoch millseconds value is potentially out of range for AK::Duration and subsequently + // The provided epoch milliseconds value is potentially out of range for AK::Duration and subsequently // get_time_zone_offset(). We can safely assume that the TZDB has no useful information that far // into the past and future anyway, so clamp it to the i64 range. if (value < min_double) diff --git a/Libraries/LibJS/SourceCode.cpp b/Libraries/LibJS/SourceCode.cpp index 551648fc7cb..b0392899e6e 100644 --- a/Libraries/LibJS/SourceCode.cpp +++ b/Libraries/LibJS/SourceCode.cpp @@ -35,7 +35,7 @@ String const& SourceCode::code() const void SourceCode::fill_position_cache() const { - constexpr size_t predicted_mimimum_cached_positions = 8; + constexpr size_t predicted_minimum_cached_positions = 8; constexpr size_t minimum_distance_between_cached_positions = 32; constexpr size_t maximum_distance_between_cached_positions = 8192; @@ -46,7 +46,7 @@ void SourceCode::fill_position_cache() const size_t line = 1; size_t column = 1; size_t offset_of_last_starting_point = 0; - m_cached_positions.ensure_capacity(predicted_mimimum_cached_positions + m_code.bytes().size() / maximum_distance_between_cached_positions); + m_cached_positions.ensure_capacity(predicted_minimum_cached_positions + m_code.bytes().size() / maximum_distance_between_cached_positions); m_cached_positions.append({ .line = 1, .column = 1, .offset = 0 }); Utf8View const view(m_code); diff --git a/Libraries/LibJS/Tests/builtins/AsyncGenerator/AsyncGenerator.prototype.next.js b/Libraries/LibJS/Tests/builtins/AsyncGenerator/AsyncGenerator.prototype.next.js index 64df810ace9..9b4eaa31ffb 100644 --- a/Libraries/LibJS/Tests/builtins/AsyncGenerator/AsyncGenerator.prototype.next.js +++ b/Libraries/LibJS/Tests/builtins/AsyncGenerator/AsyncGenerator.prototype.next.js @@ -71,9 +71,9 @@ describe("correct behaviour", () => { }); test("gets undefined in completed state", () => { - const ninethRunResult = runGenerator("bad8", false); - expect(ninethRunResult.value).toBeUndefined(); - expect(ninethRunResult.done).toBeTrue(); + const ninthRunResult = runGenerator("bad8", false); + expect(ninthRunResult.value).toBeUndefined(); + expect(ninthRunResult.done).toBeTrue(); }); async function* implicitReturnFunction() { diff --git a/Libraries/LibJS/Tests/using-declaration.js b/Libraries/LibJS/Tests/using-declaration.js index f4b1b14e576..5ee4be0069a 100644 --- a/Libraries/LibJS/Tests/using-declaration.js +++ b/Libraries/LibJS/Tests/using-declaration.js @@ -168,7 +168,7 @@ describe("behavior with exceptions", () => { expect(inCatch).toBeTrue(); }); - test.xfail("normal error and multiple disposing erorrs give chaining suppressed errors", () => { + test.xfail("normal error and multiple disposing errors give chaining suppressed errors", () => { let inCatch = false; try { using a = { [Symbol.dispose]() { @@ -345,7 +345,7 @@ describe("using is still a valid variable name", () => { }); }); -describe("syntax errors / werid artifacts which remain valid", () => { +describe("syntax errors / weird artifacts which remain valid", () => { test("no patterns in using", () => { expect("using {a} = {}").not.toEval(); expect("using a, {a} = {}").not.toEval(); diff --git a/Libraries/LibMedia/FFmpeg/FFmpegVideoDecoder.cpp b/Libraries/LibMedia/FFmpeg/FFmpegVideoDecoder.cpp index a855130579d..35ad701e9b2 100644 --- a/Libraries/LibMedia/FFmpeg/FFmpegVideoDecoder.cpp +++ b/Libraries/LibMedia/FFmpeg/FFmpegVideoDecoder.cpp @@ -242,7 +242,7 @@ DecoderErrorOr> FFmpegVideoDecoder::get_decoded_frame( case AVERROR(EINVAL): return DecoderError::with_description(DecoderErrorCategory::Invalid, "FFmpeg codec has not been opened"sv); default: - return DecoderError::format(DecoderErrorCategory::Unknown, "FFmpeg codec encountered an unexpected error retreiving frames with code {:x}", result); + return DecoderError::format(DecoderErrorCategory::Unknown, "FFmpeg codec encountered an unexpected error retrieving frames with code {:x}", result); } } diff --git a/Libraries/LibUnicode/DateTimeFormat.cpp b/Libraries/LibUnicode/DateTimeFormat.cpp index 64940a529a3..761bf523ee6 100644 --- a/Libraries/LibUnicode/DateTimeFormat.cpp +++ b/Libraries/LibUnicode/DateTimeFormat.cpp @@ -847,7 +847,7 @@ private: } // ICU 72 introduced the use of NBSP to separate time fields and day periods. All major browsers have found that - // this significantly breaks web compatibilty, and they all replace these spaces with normal ASCII spaces. See: + // this significantly breaks web compatibility, and they all replace these spaces with normal ASCII spaces. See: // // https://bugzilla.mozilla.org/show_bug.cgi?id=1806042 // https://bugs.webkit.org/show_bug.cgi?id=252147 diff --git a/Libraries/LibWasm/Parser/Parser.cpp b/Libraries/LibWasm/Parser/Parser.cpp index 18270d93a2c..e61784dce47 100644 --- a/Libraries/LibWasm/Parser/Parser.cpp +++ b/Libraries/LibWasm/Parser/Parser.cpp @@ -1149,7 +1149,7 @@ ParseResult CodeSection::Code::parse(Stream& stream) ScopeLogger logger("Code"sv); auto size = TRY_READ(stream, LEB128, ParseError::InvalidSize); - // Emprically, if there are `size` bytes to be read, then there's around + // Empirically, if there are `size` bytes to be read, then there's around // `size / 2` instructions, so we pass that as our size hint. auto func = TRY(Func::parse(stream, size / 2));