Bug 1469054 - ESLint: Drop function name. r?jdescottes
MozReview-Commit-ID: LsUzDI0fkVc
--- a/devtools/shared/adb/adb.js
+++ b/devtools/shared/adb/adb.js
@@ -182,17 +182,17 @@ const ADB = {
}
}, false);
}
},
// Start tracking devices connecting and disconnecting from the host.
// We can't reuse runCommand here because we keep the socket alive.
// @return The socket used.
- trackDevices: function adb_trackDevices() {
+ trackDevices() {
console.log("trackDevices");
const socket = client.connect();
let waitForFirst = true;
const devices = {};
socket.s.onopen = function() {
console.log("trackDevices onopen");
Services.obs.notifyObservers(null, "adb-track-devices-start");
@@ -276,17 +276,17 @@ const ADB = {
devices[dev] = newDev[dev];
}
}
}
};
},
// Sends back an array of device names.
- listDevices: function adb_listDevices() {
+ listDevices() {
console.log("listDevices");
return this.runCommand("host:devices").then(
function onSuccess(data) {
const lines = data.split("\n");
const res = [];
lines.forEach(function(line) {
if (line.length == 0) {
@@ -296,17 +296,17 @@ const ADB = {
res.push(device);
});
return res;
}
);
},
// sends adb forward localPort devicePort
- forwardPort: function adb_forwardPort(localPort, devicePort) {
+ forwardPort(localPort, devicePort) {
console.log("forwardPort " + localPort + " -- " + devicePort);
// <host-prefix>:forward:<local>;<remote>
return this.runCommand("host:forward:" + localPort + ";" + devicePort)
.then(function onSuccess(data) {
return data;
});
},
@@ -318,17 +318,17 @@ const ADB = {
// if !OKAY, return
// send STAT + hex4(path.length) + path
// recv STAT + 12 bytes (3 x 32 bits: mode, size, time)
// send RECV + hex4(path.length) + path
// while(needs data):
// recv DATA + hex4 + data
// recv DONE + hex4(0)
// send QUIT + hex4(0)
- pull: function adb_pull(from, dest) {
+ pull(from, dest) {
const deferred = PromiseUtils.defer();
let state;
let fileData = null;
let currentPos = 0;
let chunkSize = 0;
let pkgData;
const headerArray = new Uint32Array(2);
let currentHeaderLength = 0;
@@ -545,17 +545,17 @@ const ADB = {
setupSocket();
return deferred.promise;
},
// pushes a file to the device.
// from and dest are full paths.
// XXX we should STAT the remote path before sending.
- push: function adb_push(from, dest) {
+ push(from, dest) {
const deferred = PromiseUtils.defer();
let socket;
let state;
let fileSize;
let fileData;
let remaining;
let currentPos = 0;
let fileTime;
@@ -714,17 +714,17 @@ const ADB = {
deferred.reject("CANT_ACCESS_FILE");
}
);
return deferred.promise;
},
// Run a shell command
- shell: function adb_shell(command) {
+ shell(command) {
const deferred = PromiseUtils.defer();
let state;
let stdout = "";
console.log("shell " + command);
const shutdown = function() {
console.log("shell shutdown");
@@ -801,29 +801,29 @@ const ADB = {
socket.s.ondata = function(event) {
console.log("shell ondata");
runFSM(event.data);
};
return deferred.promise;
},
- reboot: function adb_reboot() {
+ reboot() {
return this.shell("reboot");
},
- rebootRecovery: function adb_rebootRecovery() {
+ rebootRecovery() {
return this.shell("reboot recovery");
},
- rebootBootloader: function adb_rebootBootloader() {
+ rebootBootloader() {
return this.shell("reboot bootloader");
},
- root: function adb_root() {
+ root() {
const deferred = PromiseUtils.defer();
let state;
console.log("root");
const shutdown = function() {
console.log("root shutdown");
socket.close();
@@ -888,17 +888,17 @@ const ADB = {
};
return deferred.promise;
},
// Asynchronously runs an adb command.
// @param command The command as documented in
// http://androidxref.com/4.0.4/xref/system/core/adb/SERVICES.TXT
- runCommand: function adb_runCommand(command) {
+ runCommand(command) {
console.log("runCommand " + command);
const deferred = PromiseUtils.defer();
if (!this.ready) {
setTimeout(function() {
deferred.reject("ADB_NOT_READY");
});
return deferred.promise;
}