[whatwg/url] New URLSearchParams algorithm does not check if optional init variable is set (#333)

The algorithm definition begins:
> To create a **new** URLSearchParams object, optionally using _init_, run these steps: 

However, the algorithm itself doesn't check to see if _init_ is given before operating on it, going so far as identify its default case as being a string:
> 4. Otherwise, _init_ is a string, then set _query_’s list to the result of parsing _init_.

Steps 2, 3, and 4 should be enclosed in a check for whether _init_ is actually given before attempting to operate on it.

-- 
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/issues/333

Received on Sunday, 9 July 2017 14:59:20 UTC