Bug Tracker

Modify

Ticket #10435 (closed enhancement: wontfix)

Opened 20 months ago

Last modified 20 months ago

jQuery.merge refactor

Reported by: MikeS Owned by:
Priority: low Milestone: None
Component: core Version: 1.7b1
Keywords: Cc:
Blocking: Blocked by:

Description

  1. the code for guessing that 2nd argument is an object is:
if ( typeof second.length === "number" ) {

it will work incorrectly for strings, plain objects with 'length' property etc. Why not use jQuery.isPlainObject here?

  1. if both arguments are plain arrays, why no use Array.concat method?

Change History

comment:1 Changed 20 months ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to wontfix
  • Status changed from new to closed
  • Component changed from unfiled to core

The simplicity and speed of merge is much more important than allowing any type of arguments, given its vast usage internally.

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.