You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jochen Kemnade (JIRA)" <ji...@apache.org> on 2013/01/08 15:12:12 UTC

[jira] [Created] (TAP5-2047) ElementWrapper#find jQuery implementation is broken if there is no match

Jochen Kemnade created TAP5-2047:
------------------------------------

             Summary: ElementWrapper#find jQuery implementation is broken if there is no match
                 Key: TAP5-2047
                 URL: https://issues.apache.org/jira/browse/TAP5-2047
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.4
            Reporter: Jochen Kemnade
         Attachments: 0001-fix-ElementWrapper-find-for-jQuery-dom-implementatio.patch

When `ElementWrapper#find` is called with a selector that does not match any element, an array of two `ElementWrapper`s with `undefined` elements is returned. That happens, because the loop that turns the jquery matches into `ElementWrapper`s iterates from `0` to `matches.length -1`. That means there is one pass for `i=0` and one pass for `i=-1`, because CoffeeScript ranges can also be specified from the higher end to the lower one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira