Browse Source

Everywhere: Change spelling of 'behaviour' to 'behavior'

"The official project language is American English […]."
https://github.com/SerenityOS/serenity/blob/5d2e9156239cd707a22ecea6c87d48e5fc1cbe84/CONTRIBUTING.md?plain=1#L30

Here's a short statistic of the occurrences of the word "behavio(u)r":

$ git grep -IPioh 'behaviou?r' | sort | uniq -c | sort -n
      2 BEHAVIOR
     24 Behaviour
     32 behaviour
    407 Behavior
    992 behavior

Therefore, it is clear that "behaviour" (56 occurrences) should be
regarded a typo, and "behavior" (1401 occurrences) should be preferred.

Note that The occurrences in LibJS are intentionally NOT changed,
because there are taken verbatim from the specification. Hence:

$ git grep -IPioh 'behaviou?r' | sort | uniq -c | sort -n
      2 BEHAVIOR
     10 behaviour
     24 Behaviour
    407 Behavior
   1014 behavior
Ben Wiederhake 2 năm trước cách đây
mục cha
commit
36ff6187f6

+ 2 - 2
AK/HashTable.h

@@ -304,9 +304,9 @@ public:
         return write_value(forward<U>(value), existing_entry_behavior);
         return write_value(forward<U>(value), existing_entry_behavior);
     }
     }
     template<typename U = T>
     template<typename U = T>
-    HashSetResult set(U&& value, HashSetExistingEntryBehavior existing_entry_behaviour = HashSetExistingEntryBehavior::Replace)
+    HashSetResult set(U&& value, HashSetExistingEntryBehavior existing_entry_behavior = HashSetExistingEntryBehavior::Replace)
     {
     {
-        return MUST(try_set(forward<U>(value), existing_entry_behaviour));
+        return MUST(try_set(forward<U>(value), existing_entry_behavior));
     }
     }
 
 
     template<typename TUnaryPredicate>
     template<typename TUnaryPredicate>

+ 2 - 2
Kernel/Memory/MemoryManager.cpp

@@ -812,7 +812,7 @@ ErrorOr<NonnullOwnPtr<Region>> MemoryManager::allocate_contiguous_kernel_region(
 ErrorOr<NonnullOwnPtr<Memory::Region>> MemoryManager::allocate_dma_buffer_page(StringView name, Memory::Region::Access access, RefPtr<Memory::PhysicalPage>& dma_buffer_page)
 ErrorOr<NonnullOwnPtr<Memory::Region>> MemoryManager::allocate_dma_buffer_page(StringView name, Memory::Region::Access access, RefPtr<Memory::PhysicalPage>& dma_buffer_page)
 {
 {
     dma_buffer_page = TRY(allocate_physical_page());
     dma_buffer_page = TRY(allocate_physical_page());
-    // Do not enable Cache for this region as physical memory transfers are performed (Most architectures have this behaviour by default)
+    // Do not enable Cache for this region as physical memory transfers are performed (Most architectures have this behavior by default)
     return allocate_kernel_region(dma_buffer_page->paddr(), PAGE_SIZE, name, access, Region::Cacheable::No);
     return allocate_kernel_region(dma_buffer_page->paddr(), PAGE_SIZE, name, access, Region::Cacheable::No);
 }
 }
 
 
@@ -827,7 +827,7 @@ ErrorOr<NonnullOwnPtr<Memory::Region>> MemoryManager::allocate_dma_buffer_pages(
 {
 {
     VERIFY(!(size % PAGE_SIZE));
     VERIFY(!(size % PAGE_SIZE));
     dma_buffer_pages = TRY(allocate_contiguous_physical_pages(size));
     dma_buffer_pages = TRY(allocate_contiguous_physical_pages(size));
-    // Do not enable Cache for this region as physical memory transfers are performed (Most architectures have this behaviour by default)
+    // Do not enable Cache for this region as physical memory transfers are performed (Most architectures have this behavior by default)
     return allocate_kernel_region(dma_buffer_pages.first()->paddr(), size, name, access, Region::Cacheable::No);
     return allocate_kernel_region(dma_buffer_pages.first()->paddr(), size, name, access, Region::Cacheable::No);
 }
 }
 
 

+ 1 - 1
Ports/README.md

@@ -302,7 +302,7 @@ Defaults to `$port-$version`.
 ### Functions
 ### Functions
 
 
 The various steps of the port installation process are split into individual
 The various steps of the port installation process are split into individual
-Bash functions, some of which can be overridden to provide custom behaviour,
+Bash functions, some of which can be overridden to provide custom behavior,
 like this:
 like this:
 
 
 ```bash
 ```bash

+ 1 - 1
Tests/AK/TestMemoryStream.cpp

@@ -72,7 +72,7 @@ TEST_CASE(allocating_memory_stream_offset_of_oob)
 {
 {
     AllocatingMemoryStream stream;
     AllocatingMemoryStream stream;
     // NOTE: This test is to make sure that offset_of() doesn't read past the end of the "initialized" data.
     // NOTE: This test is to make sure that offset_of() doesn't read past the end of the "initialized" data.
-    //       So we have to assume some things about the behaviour of this class:
+    //       So we have to assume some things about the behavior of this class:
     //       - The chunk size is 4096 bytes.
     //       - The chunk size is 4096 bytes.
     //       - A chunk is moved to the end when it's fully read from
     //       - A chunk is moved to the end when it's fully read from
     //       - A free chunk is used as-is, no new ones are allocated if one exists.
     //       - A free chunk is used as-is, no new ones are allocated if one exists.

+ 4 - 4
Userland/Libraries/LibGUI/Variant.cpp

@@ -65,12 +65,12 @@ bool Variant::operator==(Variant const& other) const
                     return own_value == other_value;
                     return own_value == other_value;
                 else if constexpr (IsSame<T, GUI::Icon>)
                 else if constexpr (IsSame<T, GUI::Icon>)
                     return &own_value.impl() == &other_value.impl();
                     return &own_value.impl() == &other_value.impl();
-                // FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it.
+                // FIXME: Figure out if this silly behavior is actually used anywhere, then get rid of it.
                 else
                 else
                     return to_deprecated_string() == other.to_deprecated_string();
                     return to_deprecated_string() == other.to_deprecated_string();
             },
             },
             [&](auto const&) {
             [&](auto const&) {
-                // FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it.
+                // FIXME: Figure out if this silly behavior is actually used anywhere, then get rid of it.
                 return to_deprecated_string() == other.to_deprecated_string();
                 return to_deprecated_string() == other.to_deprecated_string();
             });
             });
     });
     });
@@ -91,12 +91,12 @@ bool Variant::operator<(Variant const& other) const
                     return own_value->name() < other_value->name();
                     return own_value->name() < other_value->name();
                 else if constexpr (requires { own_value < other_value; })
                 else if constexpr (requires { own_value < other_value; })
                     return own_value < other_value;
                     return own_value < other_value;
-                // FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it.
+                // FIXME: Figure out if this silly behavior is actually used anywhere, then get rid of it.
                 else
                 else
                     return to_deprecated_string() < other.to_deprecated_string();
                     return to_deprecated_string() < other.to_deprecated_string();
             },
             },
             [&](auto const&) -> bool {
             [&](auto const&) -> bool {
-                return to_deprecated_string() < other.to_deprecated_string(); // FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it.
+                return to_deprecated_string() < other.to_deprecated_string(); // FIXME: Figure out if this silly behavior is actually used anywhere, then get rid of it.
             });
             });
     });
     });
 }
 }

+ 1 - 1
Userland/Libraries/LibGfx/AntiAliasingPainter.cpp

@@ -709,7 +709,7 @@ void AntiAliasingPainter::stroke_segment_intersection(FloatPoint current_line_a,
         return;
         return;
     if ((previous_horizontal || previous_vertical) && (current_horizontal || current_vertical)) {
     if ((previous_horizontal || previous_vertical) && (current_horizontal || current_vertical)) {
         intersection = m_transform.map(current_line_a);
         intersection = m_transform.map(current_line_a);
-        // Note: int_thickness used here to match behaviour of draw_line()
+        // Note: int_thickness used here to match behavior of draw_line()
         int int_thickness = AK::ceil(thickness);
         int int_thickness = AK::ceil(thickness);
         return fill_rect(FloatRect(intersection, { thickness, thickness }).translated(-int_thickness / 2), color);
         return fill_rect(FloatRect(intersection, { thickness, thickness }).translated(-int_thickness / 2), color);
     }
     }

+ 1 - 1
Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp

@@ -159,7 +159,7 @@ Bytecode::CodeGenerationErrorOr<void> ScopeNode::generate_bytecode(Bytecode::Gen
             });
             });
         });
         });
 
 
-        // 11. NOTE: No abnormal terminations occur after this algorithm step if the global object is an ordinary object. However, if the global object is a Proxy exotic object it may exhibit behaviours that cause abnormal terminations in some of the following steps.
+        // 11. NOTE: No abnormal terminations occur after this algorithm step if the global object is an ordinary object. However, if the global object is a Proxy exotic object it may exhibit behaviors that cause abnormal terminations in some of the following steps.
         // 12. NOTE: Annex B.3.2.2 adds additional steps at this point.
         // 12. NOTE: Annex B.3.2.2 adds additional steps at this point.
 
 
         // 12. Let strict be IsStrict of script.
         // 12. Let strict be IsStrict of script.

+ 1 - 1
Userland/Libraries/LibJS/Tests/builtins/Temporal/PlainTime/PlainTime.prototype.with.js

@@ -15,7 +15,7 @@ const REJECTED_CALENDAR_TYPES_THREE_ARGUMENTS = [
 
 
 const REJECTED_CALENDAR_TYPES_TWO_ARGUMENTS = [Temporal.PlainMonthDay, Temporal.PlainYearMonth];
 const REJECTED_CALENDAR_TYPES_TWO_ARGUMENTS = [Temporal.PlainMonthDay, Temporal.PlainYearMonth];
 
 
-describe("correct behaviour", () => {
+describe("correct behavior", () => {
     test("length is 1", () => {
     test("length is 1", () => {
         expect(Temporal.PlainTime.prototype.with).toHaveLength(1);
         expect(Temporal.PlainTime.prototype.with).toHaveLength(1);
     });
     });

+ 3 - 3
Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp

@@ -309,7 +309,7 @@ void HTMLHyperlinkElementUtils::set_pathname(DeprecatedString pathname)
         return;
         return;
 
 
     // 4. Set url's path to the empty list.
     // 4. Set url's path to the empty list.
-    auto url = m_url; // We copy the URL here to follow other browser's behaviour of reverting the path change if the parse failed.
+    auto url = m_url; // We copy the URL here to follow other browser's behavior of reverting the path change if the parse failed.
     url->set_paths({});
     url->set_paths({});
 
 
     // 5. Basic URL parse the given value, with url as url and path start state as state override.
     // 5. Basic URL parse the given value, with url as url and path start state as state override.
@@ -356,7 +356,7 @@ void HTMLHyperlinkElementUtils::set_search(DeprecatedString search)
         auto input = search.substring_view(search.starts_with('?'));
         auto input = search.substring_view(search.starts_with('?'));
 
 
         //    2. Set url's query to the empty string.
         //    2. Set url's query to the empty string.
-        auto url_copy = m_url; // We copy the URL here to follow other browser's behaviour of reverting the search change if the parse failed.
+        auto url_copy = m_url; // We copy the URL here to follow other browser's behavior of reverting the search change if the parse failed.
         url_copy->set_query(DeprecatedString::empty());
         url_copy->set_query(DeprecatedString::empty());
 
 
         //    3. Basic URL parse input, with null, this element's node document's document's character encoding, url as url, and query state as state override.
         //    3. Basic URL parse input, with null, this element's node document's document's character encoding, url as url, and query state as state override.
@@ -404,7 +404,7 @@ void HTMLHyperlinkElementUtils::set_hash(DeprecatedString hash)
         auto input = hash.substring_view(hash.starts_with('#'));
         auto input = hash.substring_view(hash.starts_with('#'));
 
 
         //    2. Set url's fragment to the empty string.
         //    2. Set url's fragment to the empty string.
-        auto url_copy = m_url; // We copy the URL here to follow other browser's behaviour of reverting the hash change if the parse failed.
+        auto url_copy = m_url; // We copy the URL here to follow other browser's behavior of reverting the hash change if the parse failed.
         url_copy->set_fragment(DeprecatedString::empty());
         url_copy->set_fragment(DeprecatedString::empty());
 
 
         //    3. Basic URL parse input, with url as url and fragment state as state override.
         //    3. Basic URL parse input, with url as url and fragment state as state override.

+ 3 - 3
Userland/Libraries/LibWeb/URL/URL.cpp

@@ -335,7 +335,7 @@ void URL::set_pathname(String const& pathname)
         return;
         return;
 
 
     // 2. Empty this’s URL’s path.
     // 2. Empty this’s URL’s path.
-    auto url = m_url; // We copy the URL here to follow other browser's behaviour of reverting the path change if the parse failed.
+    auto url = m_url; // We copy the URL here to follow other browser's behavior of reverting the path change if the parse failed.
     url.set_paths({});
     url.set_paths({});
 
 
     // 3. Basic URL parse the given value with this’s URL as url and path start state as state override.
     // 3. Basic URL parse the given value with this’s URL as url and path start state as state override.
@@ -384,7 +384,7 @@ WebIDL::ExceptionOr<void> URL::set_search(String const& search)
     auto input = search_as_string_view.substring_view(search_as_string_view.starts_with('?'));
     auto input = search_as_string_view.substring_view(search_as_string_view.starts_with('?'));
 
 
     // 4. Set url’s query to the empty string.
     // 4. Set url’s query to the empty string.
-    auto url_copy = url; // We copy the URL here to follow other browser's behaviour of reverting the search change if the parse failed.
+    auto url_copy = url; // We copy the URL here to follow other browser's behavior of reverting the search change if the parse failed.
     url_copy.set_query(DeprecatedString::empty());
     url_copy.set_query(DeprecatedString::empty());
 
 
     // 5. Basic URL parse input with url as url and query state as state override.
     // 5. Basic URL parse input with url as url and query state as state override.
@@ -438,7 +438,7 @@ void URL::set_hash(String const& hash)
     auto input = hash_as_string_view.substring_view(hash_as_string_view.starts_with('#'));
     auto input = hash_as_string_view.substring_view(hash_as_string_view.starts_with('#'));
 
 
     // 3. Set this’s URL’s fragment to the empty string.
     // 3. Set this’s URL’s fragment to the empty string.
-    auto url = m_url; // We copy the URL here to follow other browser's behaviour of reverting the hash change if the parse failed.
+    auto url = m_url; // We copy the URL here to follow other browser's behavior of reverting the hash change if the parse failed.
     url.set_fragment(DeprecatedString::empty());
     url.set_fragment(DeprecatedString::empty());
 
 
     // 4. Basic URL parse input with this’s URL as url and fragment state as state override.
     // 4. Basic URL parse input with this’s URL as url and fragment state as state override.

+ 1 - 1
Userland/Utilities/sql.cpp

@@ -188,7 +188,7 @@ private:
             }
             }
             return line.release_value();
             return line.release_value();
             // If the last file is exhausted but m_quit_when_files_read is false
             // If the last file is exhausted but m_quit_when_files_read is false
-            // we fall through to the standard reading from the editor behaviour
+            // we fall through to the standard reading from the editor behavior
         }
         }
         auto line_result = m_editor->get_line(prompt_for_level(m_repl_line_level));
         auto line_result = m_editor->get_line(prompt_for_level(m_repl_line_level));
         if (line_result.is_error())
         if (line_result.is_error())