Bug Tracker

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#837 closed bug (fixed)

DOM inconsistency in add(),maybe more places

Reported by: [email protected] Owned by:
Priority: major Milestone: 1.1
Component: core Version: 1.1
Keywords: Cc:
Blocked by: Blocking:


1.0.4 version has support for direct manipulation on DOM elements,something like:


where "el" is simply DOM element,now in 1.1 I need to wrap it to $(),as:

$("li.hl",p).add( $(el) ).each()

otherwise construction dosen't work at all.

Change History (2)

comment:1 Changed 16 years ago by [email protected]

OK,I found bug,1.04: add: function(t) {

return this.pushStack( jQuery.merge( this,

typeof t == "string" ? jQuery.find(t) : t.constructor == Array ? t : [t] ), arguments );

}; in 1.1 reduced to: add: ... typeof t == "string" ? jQuery(t).get() : t ...

so,it always assume "t" is "Array",that contradictonary to docs,which promote array/element/sequence(of elements) interchangeability. IMHO,it must exists generic conversion "toArray" method,used across framework everywhere,if you will,but it seems every method has it's own parameter parsing logic.

comment:2 Changed 16 years ago by john

Resolution: fixed
Status: newclosed

Fixed in SVN rev 1137.

Note: See TracTickets for help on using tickets.