You're right.  When I was testing that it turns out that I wasn't
passing any arguments to my function, and it would have behaved the
same way in 1.1.2.  However, my example is a good one - in this case,
I still want the last object's properties applied.  Does it make sense
to modify the extend function to process all of its arguments instead
of dying at the first undefined value?

On May 21, 3:16 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Daemach wrote:
> > It appears that extend no longer extends objects with more than one
> > object.  In 1.1.2 I could do:
>
> >     this.settings = jQuery.extend({}, this.defaults,
> > arguments.options, this.userOptionsFromCookie);  // named to
> > illustrate purpose
>
> > Now, only the arguments.options values extend the defaults.  Is this
> > expected behavior?
>
> Extend in 1.1.2:
>
> jQuery.extend = jQuery.fn.extend = function() {
>         // copy reference to target object
>         var target = arguments[0], a = 1;
>
>         // extend jQuery itself if only one argument is passed
>         if ( arguments.length == 1 ) {
>                 target = this;
>                 a = 0;
>         }
>         var prop;
>         while (prop = arguments[a++])
>                 // Extend the base object
>                 for ( var i in prop ) target[i] = prop[i];
>
>         // Return the modified object
>         return target;
>
> };
>
> Extends in 1.1.3:
>
> jQuery.extend = jQuery.fn.extend = function() {
>         // copy reference to target object
>         var target = arguments[0], a = 1;
>
>         // extend jQuery itself if only one argument is passed
>         if ( arguments.length == 1 ) {
>                 target = this;
>                 a = 0;
>         }
>         var prop;
>         while ( (prop = arguments[a++]) != null )
>                 // Extend the base object
>                 for ( var i in prop ) target[i] = prop[i];
>
>         // Return the modified object
>         return target;
>
> };
>
> Only the check for null was added, that shouldn't change anything for
> your code.
>
> --
> Jörn Zaefferer
>
> http://bassistance.de

Reply via email to