#10466 closed bug (fixed)
jQuery.param() mistakes wrapped primitives for deep objects
Reported by: | 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
Component: | unfiled → core |
---|---|
Milestone: | None → 1.next |
Owner: | set to Rick Waldron |
Priority: | undecided → low |
Status: | new → assigned |
comment:2 Changed 12 years ago by
comment:3 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fix #10466. jQuery.param() should treat object-wrapped primitives as primitives.
Changeset: 166b9d252a025009413eee1584dc364996dcb1c2
comment:4 Changed 11 years ago by
Milestone: | 1.next → 1.7.2 |
---|
Note: See
TracTickets for help on using
tickets.
https://github.com/jquery/jquery/pull/540