Skip to content

Commit

Permalink
Fix rest operator syntax errors
Browse files Browse the repository at this point in the history
Summary:
These are caused by new [syntax checking](https://github.com/babel/babylon/blob/1285131e3eb28ab6f5f62a7c5fd3ffd7ce1e5eb8/CHANGELOG.md#v6113-2016-10-01) introduced by babylon.

"The single rest at the end only applies to binding `let { x, ...y } = obj;` and assignment `({ x, ...y } = obj).`"

I'd say this really should be cherry picked into the stable branch.

**Test plan**
1. install [email protected]
2. see that things break
3. apply patch
4. things work
5. make sure all instances were fixed (I used `\.\.\..*,.*\n.*=` in IntelliJ regex format—find all ... followed by newline followed by =)

Issue #10199
Closes #10200

Differential Revision: D3974066

Pulled By: javache

fbshipit-source-id: 3f3c1e9df01a3b3bdd61dd3863416c638d3ed98d
mlazowik authored and Facebook Github Bot committed Oct 5, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 1941450 commit f77185f
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ function arrayContains<T>(array: Array<T>, value: T): boolean {
function createErrorFromErrorData(errorData: {message: string}): Error {
const {
message,
...extraErrorInfo,
...extraErrorInfo
} = errorData;
const error = new Error(message);
(error:any).framesToPop = 1;
2 changes: 1 addition & 1 deletion Libraries/CustomComponents/ListView/ListView.js
Original file line number Diff line number Diff line change
@@ -454,7 +454,7 @@ var ListView = React.createClass({

var {
renderScrollComponent,
...props,
...props
} = this.props;
if (!props.scrollEventThrottle) {
props.scrollEventThrottle = DEFAULT_SCROLL_CALLBACK_THROTTLE;
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ class NavigationCard extends React.Component<any, Props, any> {
pointerEvents,
renderScene,
style,
...props, /* NavigationSceneRendererProps */
...props /* NavigationSceneRendererProps */
} = this.props;

const viewStyle = style === undefined ?

0 comments on commit f77185f

Please sign in to comment.