Repository navigation
Use first binding for multiple var declarations - #5745
Conversation
Since var declarations after initial binding have no effect, use the first declaration. Fixes babel#2378
|
@peey, thanks for your PR! By analyzing the history of the files in this pull request, we identified @existentialism and @loganfsmyth to be potential reviewers. |
Codecov Report
@@ Coverage Diff @@
## 7.0 #5745 +/- ##
=========================================
- Coverage 84.63% 84.6% -0.04%
=========================================
Files 282 282
Lines 9861 9864 +3
Branches 2766 2767 +1
=========================================
- Hits 8346 8345 -1
- Misses 997 1001 +4
Partials 518 518
Continue to review full report at Codecov.
|
|
@jridgewell I forgot. I'll have to check. Also, this shouldn't be merged yet, I just noticed an error in one of the tests: this should also have been renamed to I'll patch it up and update here |
|
@jridgewell I don't think we need it, so I have removed it. The reason being that there are only two categories of redeclarations - one we're fine with and one that result in an error. The redeclarations which result in an error are taken care of here And rest of them (like |
4a0483e to
62755d0
Compare
Since var declarations after initial binding have no effect, use the first declaration (instead of last, as we were currently doing). This prevents a
parambinding from turning into avarbinding when a var declaration of the same identifier is made in the function body. Hence it fixes #2378