tc39 / proposal-optional-chaining

https://tc39.github.io/proposal-optional-chaining/
4.94k stars 75 forks source link

Add references for long short-circuiting #109

Closed jhamberg closed 5 years ago

jhamberg commented 5 years ago

Replaced [TODO: provide precise references] with references for long short-circuiting in both C# and CoffeeScript.

Documentation for C# clearly describes this behavior : "... if one operation in a chain of conditional member or element access operations returns null, the rest of the chain doesn't execute."

Documentation for CoffeeScript is a bit more vague: "If all of the properties exist then you’ll get the expected result, if the chain is broken, undefined is returned instead of the TypeError that would be raised otherwise."

CoffeeScript description is not exactly precise, but considering that throws stop evaluation early, I think the reference should be adequate. If needed, it can be excluded.

claudepache commented 5 years ago

A list of languages that have, respectively have not, long short-circuiting feature is already found in the “Prior Art” section. After having completed the Prior Art section, I’ve forgotten this TODO. Maybe just add a backlink to the Prior Art section?

jhamberg commented 5 years ago

Sounds good, added a backlink.