New issue
Advanced search Search tips

Issue 702074 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 680531
Owner: ----
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

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:
 
Cc: brajkumar@chromium.org
Labels: Needs-Feedback OS-Linux OS-Windows
Able to reproduce this issue on Ubuntu 14.04 using chrome latest stable #57.0.2987.98 by following steps mentioned in the original comment. By entering the steps 1 & 2 observed it prints the output value as `%5Bobject+Object%5D=` 

vendivel@Tested the same on other browser Firefox by following the same steps as followed in chrome observed similar behavior. Attaching screen shot for reference. Could you please confirm this?

Thanks!
702074.png
18.9 KB View Download

Comment 2 by vendi...@gmail.com, Mar 16 2017

FWIW Firefox Developer Edition 54.0a2 (2017-03-15) (64-bit) correctly performs the actions. Screenshot attached.
Screen Shot 2017-03-16 at 9.47.13 AM.png
23.8 KB View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Mar 16 2017

Labels: -Needs-Feedback
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
Cc: -brajkumar@chromium.org
Components: -Blink Blink>JavaScript
Labels: M-59
Status: Untriaged (was: Unconfirmed)

Comment 5 by sigbjo...@opera.com, Mar 17 2017

Components: -Blink>JavaScript Blink>Network
Mergedinto: 680531
Status: Duplicate (was: Untriaged)
This is the other half of  issue 680531  (constructing an object from record<K,V> initializers)

Sign in to add a comment