From 74726f0af597494cc703d6a7f58fca1503a2e6f3 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 13 Feb 2015 23:41:53 -0500 Subject: [PATCH] remove space before round brace in function expressions --- .../element/__tests__/ReactElementValidator-test.js | 2 +- src/core/__tests__/ReactCompositeComponent-test.js | 2 +- .../ReactCompositeComponentNestedState-test.js | 6 +++--- .../__tests__/ReactCompositeComponentState-test.js | 12 ++++++------ src/utils/__tests__/ReactChildren-test.js | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/classic/element/__tests__/ReactElementValidator-test.js b/src/classic/element/__tests__/ReactElementValidator-test.js index a922ffbbbb..5781db76ad 100644 --- a/src/classic/element/__tests__/ReactElementValidator-test.js +++ b/src/classic/element/__tests__/ReactElementValidator-test.js @@ -322,7 +322,7 @@ describe('ReactElementValidator', function() { expect(console.warn.calls.length).toBe(2); }); - it('should warn if a fragment is used without the wrapper', function () { + it('should warn if a fragment is used without the wrapper', function() { spyOn(console, 'warn'); var child = React.createElement('span'); React.createElement('div', null, { a: child, b: child }); diff --git a/src/core/__tests__/ReactCompositeComponent-test.js b/src/core/__tests__/ReactCompositeComponent-test.js index ac6482a910..adada42055 100644 --- a/src/core/__tests__/ReactCompositeComponent-test.js +++ b/src/core/__tests__/ReactCompositeComponent-test.js @@ -478,7 +478,7 @@ describe('ReactCompositeComponent', function() { it('should warn when shouldComponentUpdate() returns undefined', function() { var Component = React.createClass({ - getInitialState: function () { + getInitialState: function() { return {bogus: false}; }, diff --git a/src/core/__tests__/ReactCompositeComponentNestedState-test.js b/src/core/__tests__/ReactCompositeComponentNestedState-test.js index f886d2ffb8..2a647a2ad8 100644 --- a/src/core/__tests__/ReactCompositeComponentNestedState-test.js +++ b/src/core/__tests__/ReactCompositeComponentNestedState-test.js @@ -31,7 +31,7 @@ describe('ReactCompositeComponentNestedState-state', function() { handleColor: function(color) { this.props.logger('parent-handleColor', this.state.color); - this.setState({ color: color }, function () { + this.setState({ color: color }, function() { this.props.logger('parent-after-setState', this.state.color); }); }, @@ -55,11 +55,11 @@ describe('ReactCompositeComponentNestedState-state', function() { handleHue: function(shade, color) { this.props.logger('handleHue', this.state.hue, this.props.color); this.props.onSelectColor(color); - this.setState(function (state, props) { + this.setState(function(state, props) { this.props.logger('setState-this', this.state.hue, this.props.color); this.props.logger('setState-args', state.hue, props.color); return { hue: shade + ' ' + props.color } - }, function () { + }, function() { this.props.logger('after-setState', this.state.hue, this.props.color); }); }, diff --git a/src/core/__tests__/ReactCompositeComponentState-test.js b/src/core/__tests__/ReactCompositeComponentState-test.js index 3205d6d36c..ed7e521c24 100644 --- a/src/core/__tests__/ReactCompositeComponentState-test.js +++ b/src/core/__tests__/ReactCompositeComponentState-test.js @@ -57,14 +57,14 @@ describe('ReactCompositeComponent-state', function() { componentWillMount: function() { this.peekAtState('componentWillMount-start'); - this.setState(function (state) { + this.setState(function(state) { this.peekAtState('before-setState-sunrise', state); }); this.setState( {color: 'sunrise'}, this.peekAtCallback('setState-sunrise') ); - this.setState(function (state) { + this.setState(function(state) { this.peekAtState('after-setState-sunrise', state); }); this.peekAtState('componentWillMount-after-sunrise'); @@ -72,7 +72,7 @@ describe('ReactCompositeComponent-state', function() { {color: 'orange'}, this.peekAtCallback('setState-orange') ); - this.setState(function (state) { + this.setState(function(state) { this.peekAtState('after-setState-orange', state); }); this.peekAtState('componentWillMount-end'); @@ -90,19 +90,19 @@ describe('ReactCompositeComponent-state', function() { componentWillReceiveProps: function(newProps) { this.peekAtState('componentWillReceiveProps-start'); if (newProps.nextColor) { - this.setState(function (state) { + this.setState(function(state) { this.peekAtState('before-setState-receiveProps', state); return {color: newProps.nextColor}; }); this.replaceState({ color: undefined }); this.setState( - function (state) { + function(state) { this.peekAtState('before-setState-again-receiveProps', state); return {color: newProps.nextColor}; }, this.peekAtCallback('setState-receiveProps') ); - this.setState(function (state) { + this.setState(function(state) { this.peekAtState('after-setState-receiveProps', state); }); } diff --git a/src/utils/__tests__/ReactChildren-test.js b/src/utils/__tests__/ReactChildren-test.js index 8a271de6be..aaf301a17b 100644 --- a/src/utils/__tests__/ReactChildren-test.js +++ b/src/utils/__tests__/ReactChildren-test.js @@ -421,7 +421,7 @@ describe('ReactChildren', function() { expect(numberOfChildren).toBe(6); }); - it('should warn if a fragment is used without the wrapper', function () { + it('should warn if a fragment is used without the wrapper', function() { spyOn(console, 'warn'); var child = React.createElement('span'); ReactChildren.forEach({ a: child, b: child}, function(c) { @@ -431,7 +431,7 @@ describe('ReactChildren', function() { expect(console.warn.calls[0].args[0]).toContain('use of a keyed object'); }); - it('should warn if a fragment is accessed', function () { + it('should warn if a fragment is accessed', function() { spyOn(console, 'warn'); var child = React.createElement('span'); var frag = ReactChildren.map([ child, child ], function(c) {