Skip to content

Optional Catch Binding (Stage 4) #7

Open
@bakkot

Description

@bakkot

Champion: @michaelficarra
Spec repo: https://github.com/michaelficarra/optional-catch-binding-proposal/
Spec text: https://michaelficarra.github.io/optional-catch-binding-proposal/
Stage: -1 :)

Moved to Stage 3 at the July meeting https://github.com/tc39/agendas/blob/master/2017/07.md

Stage 4 at May 2018 meeting

This hasn't been presented to the committee as of this writing, but will be at the July meeting. If it receives broad support it is likely to advance quickly, in my personal estimation.

It allows the binding to be omitted from a catch clause:

try {
  throw 0;
} catch {
  doSomethingWhichDoesntCareAboutTheValueThrown();
}

or

try {
  throw 0;
} catch {
  doSomethingWhichDoesntCareAboutTheValueThrown();
} finally {
  doSomeCleanup();
}

This will need a (very small) change in Babylon, including a change to the AST (marking the catch binding as optional), and then a very small change to Babel.

This would make a great first contribution, I think!

UPDATE:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions