• 
      

    Remove the custom console.assert and shim functions.

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

    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.

    Summary ID
    Remove the custom console.assert and shim functions.
    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.
    504c46b911d2a582908c8ff369f0f23df3d53f1f
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-7.x (7c57a7e)