Re: [heycam/webidl] A non-optional dictionary argument makes sense at times. (#130)

> I'm saying that we don't have two cases, since even if we made `{}` throw, it wouldn't simplify the logic of `MutationObserver` at all.

Correct. The proposal isn't for simplifying prose. It's for removing confusion from the spec (explicitly stating "optional" on a parameter that actually isn't), requiring non-normative explanations such as the one I added in Web Share.

We should think of specs as documentation for the web platform. They aren't just some computer code that's technically correct if you consider all the logic in aggregate. They should make sense to people who glance at them to get clarification on what's allowed and what isn't. Having "optional" on an argument that always throws a TypeError if not supplied is deliberately misleading. Having a rule that forces me (as a spec author) to do this is deliberately forcing spec authors to be misleading.

> If you want a different processing model, okay, but then we'd have to make a bunch of changes.

I don't understand why we have to change the processing model. Everything should just work if you have a method with a non-optional dictionary with no required fields (just as everything works if you have a non-optional dictionary with 1 required field).

-- 
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/130#issuecomment-313273195

Received on Thursday, 6 July 2017 01:50:33 UTC