Skip to main content

Bug Tracker

Side navigation

#10435 closed enhancement (wontfix)

Opened October 06, 2011 01:07PM UTC

Closed October 06, 2011 01:27PM UTC

jQuery.merge refactor

Reported by: MikeS Owned by:
Priority: low Milestone: None
Component: core Version: 1.7b1
Keywords: Cc:
Blocked by: Blocking:
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?

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

Attachments (0)
Change History (1)

Changed October 06, 2011 01:27PM UTC by timmywil comment:1

component: unfiledcore
priority: undecidedlow
resolution: → wontfix
status: newclosed

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