Re: [whatwg/url] Remove "optional" for the init in URLSearchParams constructor? (#424)

No. Then `new URLSearchParams()` would be required to throw.

`optional` is what _allows_ the algorithm to assume that the _init_ parameter exists. It's an instruction to the IDL preprocessor steps that say "if no value was passed, or if undefined was passed, then set _init_ to the default value" (in this case indicated by `= ""`).

In other words it's syntactically invalid to have `= ""` without having `optional`.

-- 
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/424#issuecomment-453355026

Received on Friday, 11 January 2019 02:49:20 UTC