-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
[ GENERAL ][ BUGFIX ][ jest/preprocessor.js ] - Invalid use of destructuring #20178
Conversation
What version of node are you running? My understanding is that the ... there is reasonable. |
v8.0.0 It looks like I have to pass the But the code in general is strange. If destructuring is being used then why is Object.assign also used? It seems like you could write the second argument simply as:
|
It looks like node rest/spread syntax started working without the harmony flag in 8.3.0. This should work if you update to that. @hramos, we should make sure our minimum supported version is set to 8.3.0. ———— |
You are right. I updated to node v8.3.0 and it works. I went ahead and updated the pr so that portion of the code uses destructuring only and got rid of the Object.assign. I re-ran all my tests and they work fine whereas before they were complaining about the use of the spread operator. |
Maybe we should update https://github.com/facebook/react-native/blob/master/local-cli/server/checkNodeVersion.js#L17 to 8.3 then. There might be some other mentions in the doc too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TheSavior is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Pull Request resolved: facebook#20178 Differential Revision: D8860733 Pulled By: TheSavior fbshipit-source-id: ec4aa3050755652106dec9ea245394314c862e97
It looks like the commit didn't auto close this PR: 9d5bd50 |
Summary: Node rest/spread syntax started working without the harmony flag in 8.3 (#20178 (comment)). Release Notes: [GENERAL] [BREAKING] [Node] - Bump minimum req. Node version to 8.3 Pull Request resolved: #20236 Differential Revision: D8876357 Pulled By: hramos fbshipit-source-id: 1f5f791ef318e70c6be8b23d887a1d650a68e594
Summary: Adds missing comma, following up on #20178. Thanks to LinusU for pointing out the error. Reviewed By: TheSavior Differential Revision: D9242887 fbshipit-source-id: 4b547396722d0e37dc5c8eb3439b9a441c3c0ac2
Summary: Adds missing comma, following up on #20178. Thanks to LinusU for pointing out the error. Reviewed By: TheSavior Differential Revision: D9242887 fbshipit-source-id: 4b547396722d0e37dc5c8eb3439b9a441c3c0ac2
Summary: Node rest/spread syntax started working without the harmony flag in 8.3 (facebook/react-native#20178 (comment)). Release Notes: [GENERAL] [BREAKING] [Node] - Bump minimum req. Node version to 8.3 Pull Request resolved: facebook/react-native#20236 Differential Revision: D8876357 Pulled By: hramos fbshipit-source-id: 1f5f791ef318e70c6be8b23d887a1d650a68e594
Test Plan:
I had the same issues running tests as mentioned in: #19859
I followed the suggestions but ran into another error:
The
preprocessor.js
code in question is:Specifically line 46:
{sourceType: 'script', ...nodeOptions, ast: false},
is an invalid use of object destructuring and since this object is part of anObject.assign
statement I simply broke the constituents up into arguments as follows:Release Notes:
[GENERAL][BUGFIX][jest/preprocessor.js] - fixes invalid use of object destructuring in preprocessor.js