Add optionality to catch bindings#5956
Conversation
jridgewell
left a comment
There was a problem hiding this comment.
We'll also need:
- Change to
babel-typesto makeparamoptional. - Change to
babel-generatorto output a param-less clause. - A transform that generates a unique
Identifierif one is not present. - Tests for the above
packages/babel-plugin-transform-optional-catch-binding/src/index.js
Outdated
Show resolved
Hide resolved
packages/babel-plugin-transform-optional-catch-binding/README.md
Outdated
Show resolved
Hide resolved
25e8cfe to
adcd680
Compare
adcd680 to
efba0af
Compare
packages/babel-plugin-transform-optional-catch-binding/src/index.js
Outdated
Show resolved
Hide resolved
packages/babel-plugin-transform-optional-catch-binding/src/index.js
Outdated
Show resolved
Hide resolved
bb6d1cc to
1e4de40
Compare
|
Looks good! I would add a change to babel-generator Also I would add an exec test to just test that it runs correctly. |
packages/babel-plugin-transform-optional-catch-binding/src/index.js
Outdated
Show resolved
Hide resolved
packages/babel-plugin-transform-optional-catch-binding/README.md
Outdated
Show resolved
Hide resolved
.../babel-plugin-transform-optional-catch-binding/test/fixtures/optional-catch-bindings/exec.js
Show resolved
Hide resolved
|
looks good so far, basically done? We also want to do
https://github.com/babel/babel/wiki/Adding-a-new-Proposal-to-Babel Can use also https://github.com/babel/babel/pull/5813/files as a reference to files/structure/etc |
jridgewell
left a comment
There was a problem hiding this comment.
Oh, sorry, still need babel-generator updates.
4f0913b to
80f532d
Compare
packages/babel-plugin-transform-optional-catch-binding/src/index.js
Outdated
Show resolved
Hide resolved
hzoo
left a comment
There was a problem hiding this comment.
Nice work!! Great example of a good PR that implements the parser/transform/types/generator/docs change that is required for a proposal to be in Babel. I think the only thing we didn't do is add it to a stage preset since it hasn't even been presented yet 😅
This implements the optional catch binding proposal (babel/proposals #7).