#10178 closed bug (fixed)
$(window).is("a") >> Uncaught TypeError: Cannot call method 'toLowerCase' of undefined
Reported by: | Owned by: | Timmy Willison | |
---|---|---|---|
Priority: | low | Milestone: | 1.7 |
Component: | selector | Version: | 1.6.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
$(window).is("a") throws a uncaught exception
Change History (4)
comment:1 Changed 12 years ago by
Component: | unfiled → traversing |
---|---|
Priority: | undecided → low |
comment:2 Changed 12 years ago by
Component: | traversing → selector |
---|---|
Milestone: | None → 1.7 |
Owner: | set to Timmy Willison |
Status: | new → assigned |
Spoke to rwaldron. This is probably easy enough to fix and I can think of at least one case where it would be nice to have this fail silently. That is, if window is part of a larger set and the set is being filtered. Assigning to myself as this is an issue in sizzle.
comment:3 Changed 12 years ago by
Easy fix, l.4352 should be:
elem.nodeName.toLowerCase() === match; |
(elem.nodeName && elem.nodeName.toLowerCase() === match); |
It was broken for elements which does not have a "nodeName" property.
comment:4 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
I'm inclined to say don't call .is() on a window. There isn't really a useful result that can be given in this case since windows cannot be selected with a selector. I'll let someone else on the team weigh in before closing.