Skip to content
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

remove var in ReactAndroid/src/androidTest. #22137

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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