Bug Tracker

Opened 10 years ago

Closed 10 years ago

#12718 closed bug (duplicate)

matcherFromTokens, error type cannot be called from undefined

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: None
Component: selector Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:


at line 4914, the length can be 0

so the call

Expr.relative[ tokens[0].type ]

doesn't work.

I change it to

leadingRelative = len === 0 ? null : Expr.relative[ tokens[0].type ]

and it works for me.

I had this error when using jqueryui draggable.

Change History (5)

comment:1 Changed 10 years ago by dmethvin

Owner: set to [email protected]
Status: newpending

Hi Fred,

Can we have a test case? Otherwise we can't tell what the problem is or whether we have fixed it. Use jsfiddle.net or jsbin.com.

comment:2 Changed 10 years ago by [email protected]

Status: pendingnew


Yes I digged into it further here is the test http://jsfiddle.net/msr9w/ open chrome console to see Uncaught TypeError: Cannot read property 'type' of undefined

the issue comes from a selector with a comma $("li,").

it was working in previews versions, but the syntax is incorrect.

comment:3 Changed 10 years ago by dmethvin

Resolution: notabug
Status: newclosed

Yep, the error message is accurate, sorry that older versions allowed incorrect syntax.

comment:4 Changed 10 years ago by gibson042

Component: unfiledselector
Resolution: notabug
Status: closedreopened

comment:5 Changed 10 years ago by gibson042

Resolution: duplicate
Status: reopenedclosed

Duplicate of #12643.

Note: See TracTickets for help on using tickets.