Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2047

ElementWrapper#find jQuery implementation is broken if there is no match

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            hlship Howard Lewis Ship
            jkemnade Jochen Kemnade
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment