tc39 / proposal-do-expressions

Proposal for `do` expressions
MIT License
1.11k stars 14 forks source link

Invert the early error condition #70

Open lightmare opened 3 years ago

lightmare commented 3 years ago

Enumerating all the language constructs that return an unexpected value doesn't really convey the purpose of the condition — you want to make sure every branch ends with an "obvious" value-returning statement.

Replacing EndsInIterationOrBareIfOrDeclaration with e.g. EndsWithValue would make it easier to read, and better convey the intended purpose.