Skip to main content

Bug Tracker

Side navigation

#11557 closed bug (duplicate)

Opened April 05, 2012 04:50AM UTC

Closed April 05, 2012 05:21AM UTC

Last modified April 05, 2012 05:21AM UTC

Deep $.extend does not properly copy properties of custom objects

Reported by: wachunga@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

See repro:

http://jsfiddle.net/WjYWh/

One could argue that $.extend should not be expected to work with custom objects like this, but there are test cases suggesting otherwise:

https://github.com/jquery/jquery/blob/master/test/unit/core.js#L898

Being able to extend such objects (their properties, anyway) would be very nice. And in any case this kind of thing should be made explicit in the docs:

http://api.jquery.com/jQuery.extend/

(Currently there's a disclaimer about primitive types, but that's it.)

This issue was previously reported, but the reporter didn't follow up with a repro so it was closed:

http://bugs.jquery.com/ticket/10014

I tested 1.7.1 and 1.7.2, though that fiddle is currently for edge.

Attachments (0)
Change History (2)

Changed April 05, 2012 05:21AM UTC by rwaldron comment:1

resolution: → duplicate
status: newclosed

Changed April 05, 2012 05:21AM UTC by rwaldron comment:2

Duplicate of #10014.