Codebase list golang-github-tdewolff-parse / 3a696f8
JS: fix variable renaming for identifier arrow function where identifier was already used Taco de Wolff 2 years ago
1 changed file(s) with 1 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
14611461
14621462 if 1 < v.Uses {
14631463 v.Uses--
1464 v, _ = p.scope.Declare(ArgumentDecl, v.Data) // cannot fail
1464 v, _ = p.scope.Declare(ArgumentDecl, parse.Copy(v.Data)) // cannot fail
14651465 } else {
14661466 // if v.Uses==1 it must be undeclared and be the last added
14671467 p.scope.Parent.Undeclared = p.scope.Parent.Undeclared[:len(p.scope.Parent.Undeclared)-1]