-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Generating super(...arguments) in constructor #11543
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
Comments
@kittens @chancancode - I'm not sure why |
this is valid ES6 code. spread operator is allowed on arguments as well. not sure how transforming the rest of the ES6 expressions but leaving #10175 was mainly done to address emit quality for babel. i will let @chancancode reply. |
Yes, it is valid ES6 code. Since Babel has the ability to parse/compile that down to ES5 (meaning it understands the native syntax, and knows what to do if it decides the target platform doesn't support the native syntax), it seems like a bug in the babel-preset-es2015-node4 preset? |
Thank you for your input guys. I found a relevant issue that was opened with Babel, maybe someone can provide more info there. |
I was able to get some clarification on the Babel Slack. Using Thanks again! |
Hello!
MR #10189 is causing an issue after I compile TypeScript with
target
set toes6
and run it through Babel usingbabel-preset-es2015-node4
.You can find a repro here. Test by running
npm i && npm run compile && node dist/test.js
. To summarize, the following code:Results in an error:
Caused by the fact that spread is still being used in the constructor:
Not touching
arguments
is deliberate behavior on Babel's part, so I'm wondering if there is a way to make the change in #10189 more compatible with Node 4 without having to transpile to es5.The text was updated successfully, but these errors were encountered: