Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
5.4
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.