mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 13:53:22 +02:00
Fix all lib/ files with ESLint rules with 0 errors.
This commit is contained in:
@@ -30,12 +30,17 @@ FrameParser.prototype.nextFrame = function() {
|
||||
var bytesLeft = len - this.cursor
|
||||
|
||||
if (bytesLeft >= this.frameBodyLength) {
|
||||
var completeBody = this.frameBody
|
||||
? Buffer.concat([
|
||||
this.frameBody
|
||||
var completeBody
|
||||
if (this.frameBody) {
|
||||
completeBody = Buffer.concat([
|
||||
this.frameBody
|
||||
, this.chunk.slice(this.cursor, this.cursor + this.frameBodyLength)
|
||||
])
|
||||
: this.chunk.slice(this.cursor, this.cursor + this.frameBodyLength)
|
||||
])
|
||||
}
|
||||
else {
|
||||
completeBody = this.chunk.slice(this.cursor,
|
||||
this.cursor + this.frameBodyLength)
|
||||
}
|
||||
|
||||
this.cursor += this.frameBodyLength
|
||||
this.frameBodyLength = this.readFrameBytes = 0
|
||||
@@ -46,9 +51,13 @@ FrameParser.prototype.nextFrame = function() {
|
||||
else {
|
||||
// @todo Consider/benchmark continuation frames to prevent
|
||||
// potential Buffer thrashing.
|
||||
this.frameBody = this.frameBody
|
||||
? Buffer.concat([this.frameBody, this.chunk.slice(this.cursor, len)])
|
||||
: this.chunk.slice(this.cursor, len)
|
||||
if (this.frameBody) {
|
||||
this.frameBody =
|
||||
Buffer.concat([this.frameBody, this.chunk.slice(this.cursor, len)])
|
||||
}
|
||||
else {
|
||||
this.frameBody = this.chunk.slice(this.cursor, len)
|
||||
}
|
||||
|
||||
this.frameBodyLength -= bytesLeft
|
||||
this.readFrameBytes += bytesLeft
|
||||
|
||||
Reference in New Issue
Block a user