#3816 closed bug (fixed)
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: |
Description
From: http://blog.jquery.com/2008/12/22/help-test-jquery-13-beta-1/#comment-330555
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.
Thanks.
Change History (2)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Component: | core → selector |
---|---|
Milestone: | 1.3 → 1.3.1 |
Resolution: | → fixed |
Status: | new → closed |
Version: | 1.2.6 → 1.3 |
Landed a fix for this: http://github.com/jeresig/sizzle/commit/76fbebec12e998f2ce42c83084c3c9c406942986
Not sure why I was being so strict to begin with (was doing != null everywhere else).
That only true for IE: function test() var doc= window.ActiveXObject
} In IE it will be "true" but in Chrome(for example) it will be "false".