Skip to main content

Bug Tracker

Side navigation

#10466 closed bug (fixed)

Opened October 10, 2011 04:44PM UTC

Closed December 06, 2011 10:21PM UTC

Last modified March 10, 2012 03:01AM UTC

jQuery.param() mistakes wrapped primitives for deep objects

Reported by: Owned by: rwaldron
Priority: low Milestone: 1.7.2
Component: core Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:

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.

Attachments (0)
Change History (4)

Changed October 10, 2011 05:01PM UTC by rwaldron comment:1

component: unfiledcore
owner: → rwaldron
priority: undecidedlow
status: newassigned

Changed October 10, 2011 06:05PM UTC by rwaldron comment:2

Changed December 06, 2011 10:21PM UTC by Rick Waldron comment:3

resolution: → fixed
status: assignedclosed

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

Changeset: 166b9d252a025009413eee1584dc364996dcb1c2

Changed December 10, 2011 06:43PM UTC by dmethvin comment:4

milestone: 1.next1.7.2