I figured out (unfortunately not before) that the main reason why the
current implementation uses slicing is to ensure correct behavior in
case of "index out of range" and in case of !this[i].
Here proposed solutions will not return an empty jquery in that cases,
but an jquery with the document element.
Maybe this would be more appropriate:
eq: function( i ) {
return this.pushStack( i == -1 ? arraySlice.call(this, i) :
arraySlice.call(this, i, +i + 1), 'eq', i )
}
Unfortunately this looks dirty with no significant performance
improvements in respect of the first solution I purposed on
http://dev.jquery.com/ticket/4188.
Any better idea?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---