-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Duplicate parameter checking #325
Comments
There is already duplicate parameter checking (see for example |
This issue report isn't wrong, but I think you'll both appreciate some specific clarity here: Arrow functions are not strict mode by default, but they do have a supplemental grammar that must be used for their formal parameters. The supplemental syntax here: http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions uses StrictFormalParameters, which makes duplicate params a syntax error. It's an important distinction, because it means things like... let a = (x) => y = x; // will pollute the global scope
let b = (arguments) => arguments; // no error
let c = (eval) => eval; // no error |
Glad I could be helpful! :) |
Any strict-mode function with duplicate parameters is considered an error in ES6, so this:
Throws an error in Esprima and Espree. Are you open to supporting duplicate parameter checking in Acorn?
The text was updated successfully, but these errors were encountered: