• 
      

    Remove the custom console.assert and shim functions.

    Review Request #13720 — Created April 8, 2024 and submitted — Latest diff uploaded

    Information

    Review Board
    release-7.x

    Reviewers

    We've historically had some console.* shims, which were put in place
    back when browsers weren't guaranteed to provide these functions. They
    haven't been needed in a very long time.

    We did have a custom console.assert() method, which went beyond the
    standard behavior and raised an exception when an assertion failed.
    The standard behavior in browsers is to log the assertion but continue
    on. While an error probably makes more sense, it's better to go with
    default behavior and not impact any libraries that we may be using.

    Notably, using the standard console.assert() guarantees that
    message formatting string values will be respected. We could have
    patched our version to support this, but we'd have to have written
    our own string parsing for the exception. It's nicer to just let the
    native version handle all assertion logic.

    Verified this fixed issues in my assertions, and that I had no trouble
    using console methods.

    Commits

    Files