JS: fix variable renaming for identifier arrow function where identifier was already used
Taco de Wolff
2 years ago
1461 | 1461 | |
1462 | 1462 | if 1 < v.Uses { |
1463 | 1463 | v.Uses-- |
1464 | v, _ = p.scope.Declare(ArgumentDecl, v.Data) // cannot fail | |
1464 | v, _ = p.scope.Declare(ArgumentDecl, parse.Copy(v.Data)) // cannot fail | |
1465 | 1465 | } else { |
1466 | 1466 | // if v.Uses==1 it must be undeclared and be the last added |
1467 | 1467 | p.scope.Parent.Undeclared = p.scope.Parent.Undeclared[:len(p.scope.Parent.Undeclared)-1] |