Bug Tracker

Opened 10 years ago

Closed 10 years ago

#14010 closed bug (wontfix)

Improper comparison in jQuery.extend

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.1
Keywords: Cc:
Blocked by: Blocking:

Description

In jQuery.extend you have the following check:

for ( name in options ) {
	src = target[ name ];
	copy = options[ name ];

	// Prevent never-ending loop
	if ( target === copy ) {
		continue;
	}

Shouldn't this be

if (src === copy)

? Since target is a hashmap, target will never equal copy.

Thanks.

Change History (1)

comment:1 Changed 10 years ago by Rick Waldron

Resolution: wontfix
Status: newclosed
var target = {};
var recursive = { foo:target, bar:5 };
jQuery.extend(true, target, recursive);
Note: See TracTickets for help on using tickets.