Skip to content
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

Allow super when using optional chaining #498

Merged
merged 1 commit into from Jan 2, 2020

Conversation

alangpierce
Copy link
Owner

Progress toward #461

Tech plan:
https://github.com/alangpierce/sucrase/wiki/Sucrase-Optional-Chaining-and-Nullish-Coalescing-Technical-Plan

To allow super, we mostly just need to skip the code transform on the first
subscript. We also need to add a .bind(this) when transforming the second
subscript, which can be determined through a relatively straightforward token
scan.

Progress toward #461

Tech plan:
https://github.com/alangpierce/sucrase/wiki/Sucrase-Optional-Chaining-and-Nullish-Coalescing-Technical-Plan

To allow super, we mostly just need to skip the code transform on the first
subscript. We also need to add a `.bind(this)` when transforming the second
subscript, which can be determined through a relatively straightforward token
scan.
@codecov-io
Copy link

Codecov Report

Merging #498 into master will decrease coverage by 0.04%.
The diff coverage is 70%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #498      +/-   ##
==========================================
- Coverage   82.73%   82.68%   -0.05%     
==========================================
  Files          55       55              
  Lines        5589     5608      +19     
  Branches     1253     1261       +8     
==========================================
+ Hits         4624     4637      +13     
- Misses        678      681       +3     
- Partials      287      290       +3
Impacted Files Coverage Δ
...transformers/OptionalChainingNullishTransformer.ts 84.93% <70%> (-5.81%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 626ee5e...b7684f5. Read the comment docs.

@alangpierce alangpierce merged commit 3bd2674 into master Jan 2, 2020
@alangpierce alangpierce deleted the allow-super-in-optional-chaining branch January 2, 2020 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants