Bug Tracker

Opened 9 years ago

Closed 9 years ago

#3137 closed bug (fixed)

Complex selectors breaking .parents() method

Reported by: eduardo Owned by: flesler
Priority: major Milestone: 1.3
Component: selector Version: 1.2.6
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by joern)

If you try to do:

$('body').parents('#fakeId div');

this query should returns 0 elements, but this returns the <html> node.

I found probably a bug on multiFilter method on core, the regex is breaking some selectors.

old regex: expr = f.t.replace(/^\s*,\s*/, "" );

fix for this bug: expr = f.t.replace(/^\s*,?\s*/, "" );

I write a selector test case, and after this change all selectors has passed.

Anyone can confirm is it okay?

Attachments (3)

selectors.html (1.1 KB) - added by eduardo 9 years ago.
selectors.js (4.4 KB) - added by eduardo 9 years ago.
multiFilter_patch.js (1.8 KB) - added by mike.helgeson 9 years ago.

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by eduardo

Attachment: selectors.html added

Changed 9 years ago by eduardo

Attachment: selectors.js added

comment:1 Changed 9 years ago by flesler

Owner: set to flesler
Status: newassigned

comment:2 Changed 9 years ago by flesler

/\s*,?\s*/ will match ANYTHING...

comment:3 Changed 9 years ago by flesler

Component: coreselector
need: ReviewPatch

comment:4 Changed 9 years ago by joern

Related to #2851

comment:5 Changed 9 years ago by joern

Description: modified (diff)

Changed 9 years ago by mike.helgeson

Attachment: multiFilter_patch.js added

comment:7 Changed 9 years ago by dmethvin

Resolution: fixed
Status: assignedclosed

This is fixed in 1.3

Note: See TracTickets for help on using tickets.