URLSearchParams isn't properly creating an instance
Reported by
vendi...@gmail.com,
Mar 16 2017
|
||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36
Steps to reproduce the problem:
1. open Chome Dev Tools -> Console
2. var params = new URLSearchParams({key: "test"})
3. params.toString()
4. it returns `%5Bobject+Object%5D=`
What is the expected behavior?
According to the spec, the URLSearchParams.toString() method should return `key=test`. Firefox correctly does this. However, Chrome 57 returns `%5Bobject+Object%5D=`
What went wrong?
I believe that when instantiating a URLSearchParams object, it's not properly parsing the object argument, which results in a malformed value being set. The problem is cascaded when trying to get or confirm a particular key by utilizing .get('key') or .has('key'), respectively. They return undefined.
Did this work before? N/A
Chrome version: 57.0.2987.98 Channel: stable
OS Version: OS X 10.12.3
Flash Version:
,
Mar 16 2017
FWIW Firefox Developer Edition 54.0a2 (2017-03-15) (64-bit) correctly performs the actions. Screenshot attached.
,
Mar 16 2017
Thank you for providing more feedback. Adding requester "brajkumar@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 17 2017
,
Mar 17 2017
This is the other half of issue 680531 (constructing an object from record<K,V> initializers) |
||||
►
Sign in to add a comment |
||||
Comment 1 by brajkumar@chromium.org
, Mar 16 2017Labels: Needs-Feedback OS-Linux OS-Windows
18.9 KB
18.9 KB View Download