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 unused variables #22097

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion IntegrationTests/ImageSnapshotTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

const React = require('react');
const ReactNative = require('react-native');
const {Image, View} = ReactNative;
const {Image} = ReactNative;
const {TestModule} = ReactNative.NativeModules;

class ImageSnapshotTest extends React.Component<{}> {
Expand Down
36 changes: 10 additions & 26 deletions IntegrationTests/WebSocketTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ const {TestModule} = ReactNative.NativeModules;
const DEFAULT_WS_URL = 'ws://localhost:5555/';

const WS_EVENTS = ['close', 'error', 'message', 'open'];
const WS_STATES = [
/* 0 */ 'CONNECTING',
/* 1 */ 'OPEN',
/* 2 */ 'CLOSING',
/* 3 */ 'CLOSED',
];

type State = {
url: string,
Expand All @@ -50,7 +44,6 @@ class WebSocketTest extends React.Component<{}, State> {

_waitFor = (condition: any, timeout: any, callback: any) => {
let remaining = timeout;
let t;
const timeoutFunction = function() {
if (condition()) {
callback(true);
Expand All @@ -60,10 +53,10 @@ class WebSocketTest extends React.Component<{}, State> {
if (remaining === 0) {
callback(false);
} else {
t = setTimeout(timeoutFunction, 1000);
setTimeout(timeoutFunction, 1000);
}
};
t = setTimeout(timeoutFunction, 1000);
setTimeout(timeoutFunction, 1000);
};

_connect = () => {
Expand Down Expand Up @@ -121,39 +114,30 @@ class WebSocketTest extends React.Component<{}, State> {
}

testConnect = () => {
const component = this;
component._connect();
component._waitFor(component._socketIsConnected, 5, function(
connectSucceeded,
) {
this._connect();
this._waitFor(this._socketIsConnected, 5, connectSucceeded => {
if (!connectSucceeded) {
TestModule.markTestPassed(false);
return;
}
component.testSendAndReceive();
this.testSendAndReceive();
});
};

testSendAndReceive = () => {
const component = this;
component._sendTestMessage();
component._waitFor(component._receivedTestExpectedResponse, 5, function(
messageReceived,
) {
this._sendTestMessage();
this._waitFor(this._receivedTestExpectedResponse, 5, messageReceived => {
if (!messageReceived) {
TestModule.markTestPassed(false);
return;
}
component.testDisconnect();
this.testDisconnect();
});
};

testDisconnect = () => {
const component = this;
component._disconnect();
component._waitFor(component._socketIsDisconnected, 5, function(
disconnectSucceeded,
) {
this._disconnect();
this._waitFor(this._socketIsDisconnected, 5, disconnectSucceeded => {
TestModule.markTestPassed(disconnectSucceeded);
});
};
Expand Down
1 change: 0 additions & 1 deletion Libraries/Components/ScrollView/ScrollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const flattenStyle = require('flattenStyle');
const invariant = require('fbjs/lib/invariant');
const processDecelerationRate = require('processDecelerationRate');
const requireNativeComponent = require('requireNativeComponent');
const warning = require('fbjs/lib/warning');
const resolveAssetSource = require('resolveAssetSource');

import type {PressEvent} from 'CoreEventTypes';
Expand Down
10 changes: 0 additions & 10 deletions Libraries/Core/Devtools/setupDevtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@

'use strict';

type DevToolsPluginConnection = {
isAppActive: () => boolean,
host: string,
port: number,
};

type DevToolsPlugin = {
connectToDevTools: (connection: DevToolsPluginConnection) => void,
};

let register = function() {
// noop
};
Expand Down
1 change: 0 additions & 1 deletion Libraries/Experimental/Incremental.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export type Props = {
name: string,
children: React.Node,
};

type State = {
doIncrementalRender: boolean,
};
Expand Down
3 changes: 0 additions & 3 deletions local-cli/link/ios/registerNativeModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@
const xcode = require('xcode');
const fs = require('fs');
const path = require('path');
const log = require('npmlog');

const addToHeaderSearchPaths = require('./addToHeaderSearchPaths');
const getHeadersInFolder = require('./getHeadersInFolder');
const getHeaderSearchPath = require('./getHeaderSearchPath');
const getProducts = require('./getProducts');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like getProducts.js isn't accessed anywhere else and can be deleted too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove it.

const getTargets = require('./getTargets');
const createGroupWithMessage = require('./createGroupWithMessage');
const addFileToProject = require('./addFileToProject');
const addProjectToLibraries = require('./addProjectToLibraries');
const addSharedLibraries = require('./addSharedLibraries');
const isEmpty = require('lodash').isEmpty;
const getGroup = require('./getGroup');

/**
* Register native module IOS adds given dependency to project by adding
Expand Down
1 change: 0 additions & 1 deletion scripts/android-e2e-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ describe('Android Test App', function() {
});

it('should have Debug In Chrome working', function() {
const androidAppCode = fs.readFileSync('index.js', 'utf-8');
// http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_MENU
return driver
.waitForElementByXPath(
Expand Down