fix flow-double-nullable-type-cant-be-parsed#8115
fix flow-double-nullable-type-cant-be-parsed#8115existentialism merged 2 commits intobabel:masterfrom
Conversation
HassanAli321
commented
Jun 4, 2018
| Q | A |
|---|---|
| Fixed Issues? | Fixes #7924 |
| Patch: Bug Fix? | yes |
| Major: Breaking Change? | |
| Minor: New Feature? | |
| Tests Added + Pass? | |
| Documentation PR | |
| Any Dependency Changes? | |
| License | MIT |
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8309/ |
There was a problem hiding this comment.
Thank you for working on this bug!
Even if this fix is working, I don't think that it is the right approach. It would be awsome if, when parsing a type, the tokenizer didn't poduce a tt.nullishCoaleshing token but rather two tt.question tokens.
I think that it can bee done by checking that this.state.inType is false when parsing ??:
babel/packages/babel-parser/src/tokenizer/index.js
Lines 627 to 631 in b445b79
|
Thanks for sharing your point of view yeah you are right that the tokenizer should read two ?? separately i'll try this approach and update the pr :) |
1e0e010 to
ff80386
Compare
|
It needs a test 😛 |