@John: Thanks .

After a "isObject or isObjectLiteral" episode, it seems it would be
usefull to spend some time to take a "step back" and decide what goes
where in jQuery and why. And what will be made available to users, of
what is inside. I think by this I mean: What is inside jQuery core,
and why ;o) Something along the lines of recent move of some
functionality from Sizzle to the jQ core. Nothing dramatical, only
usefull.

Ah, yes, I should mention this: I am convinced that 1.4 is shaping up
really well.

--DBJ

On 11 Nov, 04:09, John Resig <jere...@gmail.com> wrote:
> If someone wants to pass in a random object to be extended we won't
> stop them. So yeah, someone could do:
>
> jQuery.extend([1,2], [3]) and get [3,2] as a result - not sure why you
> would want to, though. I can't think of a reason to explicitly prevent
> this behavior, at least.
>
> (On a related note I've renamed isObject to isObjectLiteral.)
>
> --John
>
> On Tue, Nov 10, 2009 at 9:10 PM, Robert Katić <robert.ka...@gmail.com> wrote:
> > Wat a hell is going here?
>
> >  // Recurse if we're merging object values
> > if ( deep && copy && typeof copy === "object" && !copy.nodeType ) {
> >  var clone;
>
> >  if ( src ) {
> >    clone = src;
> >  } else if ( jQuery.isArray(copy) ) {
> >    clone = [];
> >  } else if ( jQuery.isObject(copy) ) {
> >    clone = {};
> >  } else {
> >    clone = copy;
> >  }
>
> >  // Never move original objects, clone them
> >  target[ name ] = jQuery.extend( deep, clone, copy );
>
> > You are going to extend with any object including a Date, a String, a
> > Number... (ah yes, excluding nodes).
>
> > You are going to extend (with) arrays? [1,2] and [4] to obtain [4,2].
> > Really?
>
> > If an object is not an array nor an object literal then extend object
> > with itself???
>
> > The only things to extend recursively are objects literals to me:
>
> > if ( deep && copy && jQuery.isObject(copy) && (!src || jQuery.isObject
> > (src)) ) {
> >  target[ name ] = jQuery.extend( deep, src || {}, copy );
> > }
>
> > Am I loosing my mind? :)
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "jQuery Development" group.
> > To post to this group, send email to jquery-...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > jquery-dev+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/jquery-dev?hl=.

--

You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=.


Reply via email to