1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00

Fix all lib/ files with ESLint rules with 0 errors.

This commit is contained in:
Gunther Brunner 2016-01-19 20:52:38 +09:00
parent 994977ea94
commit 434f63b3a9
69 changed files with 793 additions and 764 deletions

View file

@ -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