Re: [whatwg/url] Make URLSearchParams' record constructor more flexible (#204)

@annevk, the Node.js documentation has since been [updated](https://github.com/nodejs/node/blob/a2fac322d5782a5b1802039ed477f8d4f0db2bdb/doc/api/url.md#constructor-new-urlsearchparamsobj) with the record constructor added with a big warning, one that I'd like to remove:

> *Note*: Unlike `querystring` module, duplicate keys in the form of array values are not allowed. Arrays are stringified using `array.toString()`, which simply joins all array elements with commas.
>
> ```js
> const { URLSearchParams } = require('url');
> const params = new URLSearchParams({
>   user: 'abc',
>   query: ['first', 'second']
> });
> console.log(params.getAll('query'));
>   // Prints ['first,second']
> console.log(params.toString());
>   // Prints 'user=abc&query=first%2Csecond'
> ```

@Janpot, why? It wouldn't solve the compatibility problem with Node.js, is harder to write, and would break compatibility with user agents that already implemented the record constructor.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/pull/204#issuecomment-279596693

Received on Tuesday, 14 February 2017 03:21:11 UTC