Skip to content

#1002 identical params (revised) #1543

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

Conversation

geraldalewis
Copy link
Contributor

#1002 identical params (revised)

Proposed by @TrevorBurnham
Milestone 1.1.3

Throws a SyntaxError if two parameters share the same name. As satyr points out, this brings CoffeeScript's params in line with use strict under the ES5 spec.

Original Pull Request #1531
Diff of previous patch and this version

_Revised_

  • eliminated a nested loop (param names are now added to an array, and then that array is checked for dupes). (thanks @jashkenas)
  • simple param names are added to scope immediately so that compiler-generated param names don't conflict with user-defined param names. ({},_arg)-> was causing errors in the previous patch since the compiler generating the param name _arg for {} (thanks @michaelficarra)
  • added more tests

…aram names do not conflict with user-defined param names
…param names do not conflict with user-defined param names
@michaelficarra
Copy link
Collaborator

Closing, since #2021 took care of this.

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.

2 participants