Skip to content
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

Rest argument allowed even when restParams is false #130

Closed
andy-hanson opened this issue Apr 24, 2015 · 2 comments
Closed

Rest argument allowed even when restParams is false #130

andy-hanson opened this issue Apr 24, 2015 · 2 comments

Comments

@andy-hanson
Copy link

This code succeeds:

require('espree').parse('(arg, ...args) => b', {
    ecmaFeatures: {
        restParams: false,
        arrowFunctions: true,
        destructuring: true,
        spread: true
    }
})

It requires both destructuring and spread to be on.
It seems to only happen for arrow functions with a parameter preceding the rest parameter.

@nzakas
Copy link
Member

nzakas commented Apr 24, 2015

Ah yeah, that makes sense. The rest param is initially read as spread and then changes once the arrow is seen. I'll take a look.

@nzakas
Copy link
Member

nzakas commented Apr 29, 2015

Working on this.

@nzakas nzakas closed this as completed in 491f879 Apr 29, 2015
nzakas added a commit that referenced this issue Apr 29, 2015
Fix: Don't allow arrow function rest param (fixes #130)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants