Bug Tracker

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#10466 closed bug (fixed)

jQuery.param() mistakes wrapped primitives for deep objects

Reported by: jon.rimmer@… Owned by: Rick Waldron
Priority: low Milestone: 1.7.2
Component: core Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:

Description

The output of the two following statements illustrates the problem:

$.param({ 'test': 5 }); // "test=5"
$.param({ 'test': new Number(5) }); // ""

The problem is the that the function buildParams uses the test typeof obj === 'object' to test whether a value is a deep object or not. However, if the value is a wrapped number or boolean, then they will return 'object' as well, as this will result in the field not being included in the resulting parameter string.

Change History (4)

comment:1 Changed 12 years ago by Rick Waldron

Component: unfiledcore
Milestone: None1.next
Owner: set to Rick Waldron
Priority: undecidedlow
Status: newassigned

comment:3 Changed 11 years ago by Rick Waldron

Resolution: fixed
Status: assignedclosed

Fix #10466. jQuery.param() should treat object-wrapped primitives as primitives.

Changeset: 166b9d252a025009413eee1584dc364996dcb1c2

comment:4 Changed 11 years ago by dmethvin

Milestone: 1.next1.7.2
Note: See TracTickets for help on using tickets.