• 
      

    Update _super() to be safe when used with Backbone or Spina 2 objects.

    Review Request #12901 — Created March 21, 2023 and submitted

    Information

    Review Board
    release-6.x

    Reviewers

    _super() has historically not been particularly safe, being dependent
    on how prototype chains were constructed. We've had the occasional
    problem in the past that it didn't deal with well. And its assumptions
    about what constitutes a parent prototype didn't mesh well with Spina.

    Fortunately, the version of Backbone we're now using in Review Board 6
    explicitly sets a __super__ attribute that points to the proper
    parent. The upcoming Spina 2 includes this as well. This gives us a safe
    way of using this method when objects are instances of Backbone or
    Spina 2-wrapped classes.

    This fixes upcoming issues with some mixin classes when used with the
    upcoming Spina 2.

    All unit tests pass.

    Verified this worked correctly during in-progress work for Spina 2.

    Summary ID
    Update _super() to be safe when used with Backbone or Spina 2 objects.
    `_super()` has historically not been particularly safe, being dependent on how prototype chains were constructed. We've had the occasional problem in the past that it didn't deal with well. And its assumptions about what constitutes a parent prototype didn't mesh well with Spina. Fortunately, the version of Backbone we're now using in Review Board 6 explicitly sets a `__super__` attribute that points to the proper parent. The upcoming Spina 2 includes this as well. This gives us a safe way of using this method when objects are instances of Backbone or Spina 2-wrapped classes. This fixes upcoming issues with some mixin classes when used with the upcoming Spina 2.
    fbc983375e84b5adc0fbe8cc41e8c6a80ff083c5
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-6.x (c5f1543)