Bug Tracker

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#10466 closed bug (fixed)

jQuery.param() mistakes wrapped primitives for deep objects

Reported by: jon.rimmer@… 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.

Change History (4)

comment:1 Changed 5 years ago by rwaldron

  • Component changed from unfiled to core
  • Milestone changed from None to 1.next
  • Owner set to rwaldron
  • Priority changed from undecided to low
  • Status changed from new to assigned

comment:3 Changed 4 years ago by Rick Waldron

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Changeset: 166b9d252a025009413eee1584dc364996dcb1c2

comment:4 Changed 4 years ago by dmethvin

  • Milestone changed from 1.next to 1.7.2
Note: See TracTickets for help on using tickets.