Re: [heycam/webidl] Getting rid of optional (#905)

I agree that this is not like other defaults. But I think that's OK.

Another way to think about it is to realize how weird the current `optional` keyword is. In `foo(boolean abc = false)`, the `abc` argument is "optional": the web developer doesn't have to pass it in. But we don't use the `optional` keyword for that---because it's redundant with the default value. Similarly, if we can use `undefined` as a default value, then adding the `optional` keyword becomes redundant for the `foo(DOMString abc = undefined)` case.

In other words, it is good to align the case of "allows no argument and gets a default value of `false`" with "allows no argument and gets a default value of `undefined`".

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/905#issuecomment-670554790

Received on Friday, 7 August 2020 14:50:05 UTC