mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
remove space before round brace in function expressions
This commit is contained in:
@@ -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 });
|
||||
|
||||
@@ -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};
|
||||
},
|
||||
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user