mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 06:53:20 +02:00
Fix all lib/ files with ESLint rules with 0 errors.
This commit is contained in:
@@ -176,11 +176,13 @@ module.exports = syrup.serial()
|
||||
}
|
||||
|
||||
FrameProducer.prototype.nextFrame = function() {
|
||||
var frame = null, chunk
|
||||
var frame = null
|
||||
var chunk
|
||||
|
||||
if (this.parser) {
|
||||
while ((frame = this.parser.nextFrame()) === null) {
|
||||
if ((chunk = this.socket.stream.read())) {
|
||||
chunk = this.socket.stream.read()
|
||||
if (chunk) {
|
||||
this.parser.push(chunk)
|
||||
}
|
||||
else {
|
||||
@@ -243,9 +245,9 @@ module.exports = syrup.serial()
|
||||
return lifecycle.fatal()
|
||||
}
|
||||
|
||||
var match
|
||||
if ((match = /^PID: (\d+)$/.exec(line))) {
|
||||
this.pid = +match[1]
|
||||
var match = /^PID: (\d+)$/.exec(line)
|
||||
if (match) {
|
||||
this.pid = Number(match[1])
|
||||
this.emit('pid', this.pid)
|
||||
}
|
||||
|
||||
@@ -259,7 +261,7 @@ module.exports = syrup.serial()
|
||||
}
|
||||
|
||||
var pidListener
|
||||
return new Promise(function(resolve/*, reject*/) {
|
||||
return new Promise(function(resolve) {
|
||||
this.on('pid', pidListener = resolve)
|
||||
}.bind(this)).bind(this)
|
||||
.timeout(2000)
|
||||
@@ -279,7 +281,7 @@ module.exports = syrup.serial()
|
||||
if (/closed/.test(err.message) && times > 1) {
|
||||
return Promise.delay(delay)
|
||||
.then(function() {
|
||||
return tryConnect(--times, delay * 2)
|
||||
return tryConnect(times - 1, delay * 2)
|
||||
})
|
||||
}
|
||||
return Promise.reject(err)
|
||||
@@ -326,7 +328,7 @@ module.exports = syrup.serial()
|
||||
socket.stream.removeListener('readable', this.readableListener)
|
||||
|
||||
var endListener
|
||||
return new Promise(function(resolve/*, reject*/) {
|
||||
return new Promise(function(resolve) {
|
||||
socket.on('end', endListener = function() {
|
||||
resolve(true)
|
||||
})
|
||||
@@ -354,8 +356,8 @@ module.exports = syrup.serial()
|
||||
}
|
||||
|
||||
var signum = {
|
||||
'SIGTERM': -15
|
||||
, 'SIGKILL': -9
|
||||
SIGTERM: -15
|
||||
, SIGKILL: -9
|
||||
}[signal]
|
||||
|
||||
log.info('Sending %s to minicap', signal)
|
||||
@@ -478,8 +480,8 @@ module.exports = syrup.serial()
|
||||
})
|
||||
|
||||
frameProducer.on('readable', function next() {
|
||||
var frame
|
||||
if ((frame = frameProducer.nextFrame())) {
|
||||
var frame = frameProducer.nextFrame()
|
||||
if (frame) {
|
||||
Promise.settle([broadcastSet.keys().map(function(id) {
|
||||
return broadcastSet.get(id).onFrame(frame)
|
||||
})]).then(next)
|
||||
@@ -557,8 +559,8 @@ module.exports = syrup.serial()
|
||||
}
|
||||
|
||||
ws.on('message', function(data) {
|
||||
var match
|
||||
if ((match = /^(on|off|(size) ([0-9]+)x([0-9]+))$/.exec(data))) {
|
||||
var match = /^(on|off|(size) ([0-9]+)x([0-9]+))$/.exec(data)
|
||||
if (match) {
|
||||
switch (match[2] || match[1]) {
|
||||
case 'on':
|
||||
broadcastSet.insert(id, {
|
||||
@@ -570,7 +572,8 @@ module.exports = syrup.serial()
|
||||
broadcastSet.remove(id)
|
||||
break
|
||||
case 'size':
|
||||
frameProducer.updateProjection(+match[3], +match[4])
|
||||
frameProducer.updateProjection(
|
||||
Number(match[3]), Number(match[4]))
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user