Skip to main content

Bug Tracker

Side navigation

#14010 closed bug (wontfix)

Opened June 11, 2013 10:03PM UTC

Closed June 11, 2013 10:13PM UTC

Improper comparison in jQuery.extend

Reported by: jquery@howcheng.com 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.

Attachments (0)
Change History (1)

Changed June 11, 2013 10:13PM UTC by rwaldron comment:1

resolution: → wontfix
status: newclosed
var target = {};
var recursive = { foo:target, bar:5 };
jQuery.extend(true, target, recursive);