IE doesn't like doing attaching the mergeNum property to XML documents, so for now, we're just going to (possibly) return duplicates in IE, in XML documents. (bug #1357).

This commit is contained in:
John Resig 2007-07-20 18:08:29 +00:00
parent eb5529eac0
commit 3604d14896

View file

@ -1666,11 +1666,15 @@ jQuery.extend({
unique: function(first) { unique: function(first) {
var r = [], num = jQuery.mergeNum++; var r = [], num = jQuery.mergeNum++;
try {
for ( var i = 0, fl = first.length; i < fl; i++ ) for ( var i = 0, fl = first.length; i < fl; i++ )
if ( num != first[i].mergeNum ) { if ( num != first[i].mergeNum ) {
first[i].mergeNum = num; first[i].mergeNum = num;
r.push(first[i]); r.push(first[i]);
} }
} catch(e) {
r = first;
}
return r; return r;
}, },