Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14010 closed bug (wontfix)

Improper comparison in jQuery.extend

Reported by: jquery@… 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 6 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.