Skip to main content

Bug Tracker

Side navigation

#3816 closed bug (fixed)

Opened January 09, 2009 01:57PM UTC

Closed January 18, 2009 12:56AM UTC

Last modified March 14, 2012 11:14PM UTC

Sizzle.filter and xml

Reported by: XASD Owned by:
Priority: major Milestone: 1.3.1
Component: selector Version: 1.3
Keywords: Sizzle,xml Cc:
Blocked by: Blocking:


On Sizzle.filter,line:

for ( var i = 0; (item = curLoop[i]) !== undefined; i++ ) {


you use strict “!==”,so you’ll get “true” if curLoop[i] is “null”.But for xml node lists access to not existent element in list result “null” not “undefined”,like in html dom.

Maybe you want to gain another millisecond,but in this case just do “!=”,it’s enough and correct IMHO.

Beta 2 of 1.3 still have that bug.


Attachments (0)
Change History (2)

Changed January 11, 2009 01:43PM UTC by XASD comment:1

That only true for IE:

function test()

var doc= window.ActiveXObject

? new ActiveXObject("msxml2.domdocument")

: document.implementation.createDocument("", "", null)

return doc.childNodes[0]!==undefined;


In IE it will be "true" but in Chrome(for example) it will be "false".

Changed January 18, 2009 12:56AM UTC by john comment:2

component: coreselector
resolution: → fixed
status: newclosed

Landed a fix for this:

Not sure why I was being so strict to begin with (was doing != null everywhere else).