Skip to content

Commit

Permalink
remove var in ReactAndroid/src/androidTest. (#22137)
Browse files Browse the repository at this point in the history
Summary:
I removed var in ReactAndroid/src/androidTest.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ReactAndroid/src/androidTest] - remove var
Pull Request resolved: #22137

Differential Revision: D12921228

Pulled By: TheSavior

fbshipit-source-id: d3b7380b6047fc304265d0f47a53cb1170a6aea6
  • Loading branch information
nissy-dev authored and facebook-github-bot committed Nov 5, 2018
1 parent 0beb1cc commit 6f781d9
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 53 deletions.
4 changes: 2 additions & 2 deletions ReactAndroid/src/androidTest/js/Asserts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

'use strict';

var Assert = require('NativeModules').Assert;
const Assert = require('NativeModules').Assert;

var Asserts = {
const Asserts = {
assertEquals: function(expected, actual, msg) {
if (expected !== actual) {
Assert.fail(
Expand Down
6 changes: 3 additions & 3 deletions ReactAndroid/src/androidTest/js/CatalystRootViewTestModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

'use strict';

var React = require('React');
var Recording = require('NativeModules').Recording;
var View = require('View');
const React = require('React');
const Recording = require('NativeModules').Recording;
const View = require('View');

class CatalystRootViewTestApp extends React.Component {
componentWillUnmount() {
Expand Down
13 changes: 7 additions & 6 deletions ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@

'use strict';

var BatchedBridge = require('BatchedBridge');
var DatePickerAndroid = require('DatePickerAndroid');
var React = require('React');
var RecordingModule = require('NativeModules').DatePickerDialogRecordingModule;
var View = require('View');
const BatchedBridge = require('BatchedBridge');
const DatePickerAndroid = require('DatePickerAndroid');
const React = require('React');
const RecordingModule = require('NativeModules')
.DatePickerDialogRecordingModule;
const View = require('View');

class DatePickerDialogTestApp extends React.Component {
render() {
return <View />;
}
}

var DatePickerDialogTestModule = {
const DatePickerDialogTestModule = {
DatePickerDialogTestApp: DatePickerDialogTestApp,
showDatePickerDialog: function(options) {
DatePickerAndroid.open(options).then(
Expand Down
4 changes: 2 additions & 2 deletions ReactAndroid/src/androidTest/js/ImageOverlayColorTestApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

'use strict';

var React = require('React');
var Image = require('Image');
const React = require('React');
const Image = require('Image');

class ImageOverlayColorTestApp extends React.Component {
render() {
Expand Down
6 changes: 3 additions & 3 deletions ReactAndroid/src/androidTest/js/InitialPropsTestApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

'use strict';

var React = require('React');
var RecordingModule = require('NativeModules').InitialPropsRecordingModule;
var Text = require('Text');
const React = require('React');
const RecordingModule = require('NativeModules').InitialPropsRecordingModule;
const Text = require('Text');

class InitialPropsTestApp extends React.Component {
componentDidMount() {
Expand Down
18 changes: 9 additions & 9 deletions ReactAndroid/src/androidTest/js/JSResponderTestApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

'use strict';

var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');
var Text = require('Text');
var PanResponder = require('PanResponder');
var ScrollView = require('ScrollView');
const React = require('React');
const StyleSheet = require('StyleSheet');
const View = require('View');
const Text = require('Text');
const PanResponder = require('PanResponder');
const ScrollView = require('ScrollView');

class JSResponderTestApp extends React.Component {
_handleMoveShouldSetPanResponder = (e, gestureState) => {
Expand All @@ -28,8 +28,8 @@ class JSResponderTestApp extends React.Component {
}

render() {
var views = [];
for (var i = 0; i < 100; i++) {
const views = [];
for (let i = 0; i < 100; i++) {
views[i] = (
<View key={i} style={styles.row} collapsable={false}>
<Text>I am row {i}</Text>
Expand All @@ -49,7 +49,7 @@ class JSResponderTestApp extends React.Component {
}
}

var styles = StyleSheet.create({
const styles = StyleSheet.create({
container: {
flex: 1,
},
Expand Down
8 changes: 4 additions & 4 deletions ReactAndroid/src/androidTest/js/LayoutEventsTestApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

'use strict';

var React = require('React');
var View = require('View');
const React = require('React');
const View = require('View');

var RecordingModule = require('NativeModules').Recording;
const RecordingModule = require('NativeModules').Recording;

const LAYOUT_SPECS = [
[10, 10, 100, 100],
Expand All @@ -31,7 +31,7 @@ class LayoutEventsTestApp extends React.Component {
}

handleOnLayout = e => {
var layout = e.nativeEvent.layout;
const layout = e.nativeEvent.layout;
RecordingModule.record(
layout.x + ',' + layout.y + '-' + layout.width + 'x' + layout.height,
);
Expand Down
20 changes: 10 additions & 10 deletions ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

'use strict';

var BatchedBridge = require('BatchedBridge');
var React = require('React');
var ReactNative = require('ReactNative');
var View = require('View');
var StyleSheet = require('StyleSheet');
var UIManager = require('UIManager');
const BatchedBridge = require('BatchedBridge');
const React = require('React');
const ReactNative = require('ReactNative');
const View = require('View');
const StyleSheet = require('StyleSheet');
const UIManager = require('UIManager');

var assertEquals = require('Asserts').assertEquals;
const assertEquals = require('Asserts').assertEquals;

var styles = StyleSheet.create({
const styles = StyleSheet.create({
A: {
width: 500,
height: 500,
Expand Down Expand Up @@ -46,7 +46,7 @@ var styles = StyleSheet.create({
},
});

var A, B, C, D;
let A, B, C, D;

class MeasureLayoutTestApp extends React.Component {
componentDidMount() {
Expand All @@ -72,7 +72,7 @@ function shouldNotCallThisCallback() {
assertEquals(false, true);
}

var MeasureLayoutTestModule = {
const MeasureLayoutTestModule = {
MeasureLayoutTestApp: MeasureLayoutTestApp,
verifyMeasureOnViewA: function() {
UIManager.measure(A, function(a, b, width, height, x, y) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

'use strict';

var React = require('React');
var Recording = require('NativeModules').Recording;
var StyleSheet = require('StyleSheet');
var TouchEventUtils = require('fbjs/lib/TouchEventUtils');
var View = require('View');
const React = require('React');
const Recording = require('NativeModules').Recording;
const StyleSheet = require('StyleSheet');
const TouchEventUtils = require('fbjs/lib/TouchEventUtils');
const View = require('View');

class TouchTestApp extends React.Component {
handleStartShouldSetResponder = e => {
Expand Down Expand Up @@ -57,7 +57,7 @@ class TouchTestApp extends React.Component {
}
}

var styles = StyleSheet.create({
const styles = StyleSheet.create({
container: {
flex: 1,
},
Expand Down
16 changes: 8 additions & 8 deletions ReactAndroid/src/androidTest/js/PickerAndroidTestModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

'use strict';

var BatchedBridge = require('BatchedBridge');
var React = require('React');
var RecordingModule = require('NativeModules').PickerAndroidRecordingModule;
var Picker = require('Picker');
var View = require('View');
const BatchedBridge = require('BatchedBridge');
const React = require('React');
const RecordingModule = require('NativeModules').PickerAndroidRecordingModule;
const Picker = require('Picker');
const View = require('View');

var Item = Picker.Item;
const Item = Picker.Item;

var appInstance;
let appInstance;

class PickerAndroidTestApp extends React.Component {
state = {
Expand Down Expand Up @@ -69,7 +69,7 @@ class PickerAndroidTestApp extends React.Component {
};
}

var PickerAndroidTestModule = {
const PickerAndroidTestModule = {
PickerAndroidTestApp: PickerAndroidTestApp,
selectItem: function(value) {
appInstance.setState({selected: value});
Expand Down

0 comments on commit 6f781d9

Please sign in to comment.