Skip to content

Commit

Permalink
JS: fix variable renaming for identifier arrow function where identif…
Browse files Browse the repository at this point in the history
…ier was already used
  • Loading branch information
tdewolff committed Mar 30, 2022
1 parent e4c6163 commit 3a696f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ func (p *Parser) parseIdentifierArrowFunc(v *Var) (arrowFunc *ArrowFunc) {

if 1 < v.Uses {
v.Uses--
v, _ = p.scope.Declare(ArgumentDecl, v.Data) // cannot fail
v, _ = p.scope.Declare(ArgumentDecl, parse.Copy(v.Data)) // cannot fail
} else {
// if v.Uses==1 it must be undeclared and be the last added
p.scope.Parent.Undeclared = p.scope.Parent.Undeclared[:len(p.scope.Parent.Undeclared)-1]
Expand Down

0 comments on commit 3a696f8

Please sign in to comment.