• 
      

    Get rid of usage of monkey-patched String methods.

    Review Request #13494 — Created Jan. 9, 2024 and submitted

    Information

    Review Board
    master

    Reviewers

    From a very early time, we had a few things that Djblets monkey-patched
    into the standard String class for JS code. This change gets rid of the
    use of those in the RB codebase:

    • String.trim() is a standard-library method that does what our
      String.strip() method did.
    • _.escape() and _.unescape() do what our String.htmlEncode() and
      String.htmlDecode() methods did (plus are slightly more complete).
    • String.stripTags() was only used in one place, which was already
      doing some regex transformations, so I've just moved the
      implementation of that into where it's used. We don't use that option
      at all, though, so perhaps we should just remove it from the inline
      editor too.

    Ran js-tests.

    Summary ID
    Get rid of usage of monkey-patched String methods.
    From a very early time, we had a few things that Djblets monkey-patched into the standard String class for JS code. This change gets rid of the use of those in the RB codebase: * `String.trim()` is a standard-library method that does what our `String.strip()` method did. * `_.escape()` and `_.unescape()` do what our `String.htmlEncode()` and `String.htmlDecode()` methods did (plus are slightly more complete). * `String.stripTags()` was only used in one place, which was already doing some regex transformations, so I've just moved the implementation of that into where it's used. We don't use that option at all, though, so perhaps we should just remove it from the inline editor too. Testing Done: Ran js-tests.
    2e8ff2535defc08f390ac72a8ea5850a84a160af
    chipx86
    1. Ship It!
    2. 
        
    maubin
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-7.x (850af0a)