- From: Tab Atkins Jr. <notifications@github.com>
- Date: Fri, 07 Aug 2020 08:33:59 -0700
- To: heycam/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <heycam/webidl/pull/906/c670576036@github.com>
Oh dang, upon review it would actually be even worse than I thought to handle in the grammar - I'd have to split the *typedef* production as well so that typedefs with an `undefined` in them are only usable in return types. :( Basically every single place where a type is mentioned needs to split into a Return* variant to enforce this. > I don't understand why it's important to avoid verbosity in the grammar here. Overall, simple grammars are better because they're easier to read and understand, and easier to maintain over time without mistakes or oversights. Grammar simplicity is mostly a "spec author" convenience in the priority of constituencies, slightly a "UA author" issue. > What else is the grammar for, if not to enforce restrictions of this sort? "Of this sort", sure. My objection is that this isn't actually a restriction worth enforcing in the first place, so it's not worth adding a bunch of complexity for. We should add restrictions when we think spec authors will actually make a mistake that they'd appreciate being informed about. If we're really concerned with people doing `= undefined` defaults before we make a final decision about `optional`, I'll just remove that part of the patch. But banning `undefined` from argument types seems like something we really don't need to care about, imo. -- 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/pull/906#issuecomment-670576036
Received on Friday, 7 August 2020 15:34:12 UTC