Modify ↓
Ticket #10178 (closed bug: fixed)
$(window).is("a") >> Uncaught TypeError: Cannot call method 'toLowerCase' of undefined
| Reported by: | ronny@… | Owned by: | timmywil |
|---|---|---|---|
| Priority: | low | Milestone: | 1.7 |
| Component: | selector | Version: | 1.6.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
$(window).is("a") throws a uncaught exception
Change History
comment:1 Changed 21 months ago by timmywil
- Priority changed from undecided to low
- Component changed from unfiled to traversing
comment:2 Changed 21 months ago by timmywil
- Owner set to timmywil
- Status changed from new to assigned
- Component changed from traversing to selector
- Milestone changed from None to 1.7
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 21 months ago by anonymous
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.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
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.