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

Unexpected token error for rest parameter #5411

Closed
pranaydutta89 opened this issue Feb 24, 2016 · 3 comments
Closed

Unexpected token error for rest parameter #5411

pranaydutta89 opened this issue Feb 24, 2016 · 3 comments
Labels
question Issues that look for answers.

Comments

@pranaydutta89
Copy link

i am trying to use es6 rest parameters
class mediasController extends lib.baseClasses.apiControllerAsyncBase().apiControllerAsync { constructor(...args) { super(...args); this.xyz = {}; }

but when i run the code it gives me error as "unexpected token .." ,i am using node version 4.2.6, please provide me with the solution of the same.

@evanlucas
Copy link
Contributor

Rest parameters are behind a flag (--es_staging) in node v4 and v5. With them being behind a flag, there could be things that do not work properly. They should be available in the next major version of node (v6). Thanks!

@ChALkeR
Copy link
Member

ChALkeR commented Feb 25, 2016

@pranaydutta89 You would probably want to use babel for now.

@ChALkeR ChALkeR added the question Issues that look for answers. label Feb 25, 2016
@pranaydutta89
Copy link
Author

@ChALkeR i am using typescript it's generating the above code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

3 participants