Bug Tracker

Modify

Ticket #11411 (closed bug: duplicate)

Opened 15 months ago

Last modified 15 months ago

jQuery.extend may not work well, when a boolean value is not specified at the first argument.

Reported by: turbo@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.4
Keywords: Cc:
Blocking: Blocked by:

Description

In jQuery 1.6.4, jQuery.extend may not work well, when a boolean value is not specified at the first argument.

1) jQuery.extend(target, obj1) 2) jQuery.extend(false, target, obj1)

I expect the same object will be returned both 1) and 2). But 1) and 2) sometimes return the dirrent objects.

At line 328 of jquery-1.6.4.js, there is "target = arguments[0]
{}". When argument[0] value is false, target is set to {}.
Then "target = arguments[1]
{};" and "i = 2;" at line 336-338 will not be processed, because "if ( typeof target === "boolean" )" at line 334 will not be true.

Change History

comment:1 Changed 15 months ago by gibson042

Duplicate of #10867.

comment:2 Changed 15 months ago by timmywil

  • Status changed from new to closed
  • Resolution set to duplicate

comment:3 Changed 15 months ago by timmywil

Duplicate of #10867.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.