Tapestry 5
  1. Tapestry 5
  2. TAP5-1716

Zone updates fail due to underscore.js critical bug

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 5.3, 5.4
    • Fix Version/s: 5.3
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Zone updates that reload scripts fail due to scripts reloading multiple times.
      This is due to underscore.js _contains() bug which Tapestry just started using.

      When another JS library overrides Array.prototype.indexOf, the code that
      has the bug is executed. It is not executed otherwise.

      Basically, _.contains() never returns true in this case, which leads
      to multiple reloads of stylesheets and scripts.

      I also submitted this patch to underscore.js developers.
      Patch is included.

          • new/org/apache/tapestry5/underscore_1_1_7.js 2011-10-22 05:10:36.000000000 -0400
          • old/org/apache/tapestry5/underscore_1_1_7.js 2011-08-06 12:27:18.000000000 -0400
            ***************
          • 198,205 ****
            var found = false;
            if (obj == null) return found;
            if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
            ! found = any(obj, function(value) { ! if (value === target) return true; }

            );
            return found;
            };

          • 198,205 ----
            var found = false;
            if (obj == null) return found;
            if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
            ! any(obj, function(value) { ! if (found = value === target) return true; }

            );
            return found;
            };

        Activity

        Howard M. Lewis Ship made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Fix Version/s 5.3 [ 12316024 ]
        Resolution Fixed [ 1 ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        Assignee Howard M. Lewis Ship [ hlship ]
        Lenny Primak created issue -

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Lenny Primak
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development