-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grammar: 'using () {}' vs 'try () {}' #20
Comments
The choice here is similar to the match vs case decision for pattern matching. I think we should decide in general whether we are OK with adding this type of contextual keyword going forward, which involves more complex cover grammars similar to those added for async arrow functions. Cc @bakkot @waldemarhorwat |
Aside any grammar issues, I believe that adding new reserved keywords to a language should be done carefully. For example, while adding Also, this may not be a strong argument, but given Brendan Eich clear inspiration on Java for creating Javascript, sticking with the known |
I think having Given that this will work without conflict, as it doesn't introduce a new top-level syntax keyword, the only benefit I see to not using |
tc39/proposal-optional-chaining#77 also want |
Switched to |
Although there is a separate syntax discussion ongoing in #11, I'd like to have a separate discussion on the merits of aligning somewhat with Java's
try
-with-resources syntax:Note that Java also allows you to couple
try
-with-resources with additional optionalcatch
andfinally
clauses:Which would be semantically equivalent to:
The text was updated successfully, but these errors were encountered: