Skip to main content

Bug Tracker

Side navigation

#4321 closed bug (fixed)

Opened March 10, 2009 01:15PM UTC

Closed April 06, 2011 02:18AM UTC

Last modified March 09, 2012 10:09AM UTC

$("#") returns undefined

Reported by: vkvkvk Owned by: rwaldron
Priority: low Milestone: 1.6
Component: selector Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:
Description

$("#") returns "undefined".

Opera ver 9.6 throws exception.

Old version JQuery returns JQuery object (length=0)

Attachments (0)
Change History (10)

Changed August 09, 2009 01:27AM UTC by dmethvin comment:1

component: unfilledselector
owner: → john

It's an error case...I guess it should return an empty object though.

Changed October 29, 2009 05:19AM UTC by davidserduke comment:2

Seems like a pretty specific and rare special case that isn't worth expanding the code base to fix. That said I think this might work and not require any more code (needs more testing though):

Change

quickExpr = /^[^<]*(<(.|\\s)+>)[^>]*$|^#([\\w-]+)$/

to

quickExpr = /^[^<]*(<(.|\\s)+>)[^>]*$|^#([\\w-]*)$/

which is just changing + which requires at least one character to * which doesn't (this special case where input is "#").

Changed October 27, 2010 01:04AM UTC by rwaldron comment:3

keywords: → regression
milestone: 1.41.4.4
priority: majorlow
status: newopen
version: 1.3.21.4.3

Confirmed; However this is not documented in the API as a valid selector, however IS a regression in behaviour

exception thrown in 1.4.4rc1

http://jsfiddle.net/rwaldron/eHtAU/2/

passes with 1.2.6

http://jsfiddle.net/rwaldron/eHtAU/3/

Changed October 27, 2010 09:42PM UTC by snover comment:4

keywords: regressionregression needsreview
milestone: 1.4.4

Retargeting to future since this is not likely to actually affect anyone.

Changed December 27, 2010 10:25PM UTC by rwaldron comment:5

owner: johnrwaldron
status: openassigned

Changed January 01, 2011 10:51PM UTC by rwaldron comment:6

Changed March 31, 2011 02:05AM UTC by danheberden comment:7

keywords: regression needsreviewregression needsreview pullreq
milestone: → 1.next

Changed April 01, 2011 02:32AM UTC by dmethvin comment:8

keywords: regression needsreview pullreq

Changed April 06, 2011 02:18AM UTC by dmethvin comment:9

resolution: → fixed
status: assignedclosed

Landed pull 160.

Changed April 06, 2011 02:18AM UTC by dmethvin comment:10

milestone: 1.next1.6