From 3630d80f1790755a9e467bf132335dc1bdb03fa0 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 28 Jul 2017 23:41:41 -0400 Subject: [PATCH] lint: remove unreachable conditional --- lib/protocol/Protocol.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/protocol/Protocol.js b/lib/protocol/Protocol.js index c32ecefa5..69032d849 100644 --- a/lib/protocol/Protocol.js +++ b/lib/protocol/Protocol.js @@ -192,24 +192,19 @@ Protocol.prototype._enqueue = function(sequence) { Protocol.prototype._validateEnqueue = function _validateEnqueue(sequence) { var err; var prefix = 'Cannot enqueue ' + sequence.constructor.name; - var prefixBefore = prefix + ' before '; - var prefixAfter = prefix + ' after '; if (this._fatalError) { - err = new Error(prefixAfter + 'fatal error.'); + err = new Error(prefix + ' after fatal error.'); err.code = 'PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR'; } else if (this._quitSequence) { - err = new Error(prefixAfter + 'invoking quit.'); + err = new Error(prefix + ' after invoking quit.'); err.code = 'PROTOCOL_ENQUEUE_AFTER_QUIT'; } else if (this._destroyed) { - err = new Error(prefixAfter + 'being destroyed.'); + err = new Error(prefix + ' after being destroyed.'); err.code = 'PROTOCOL_ENQUEUE_AFTER_DESTROY'; } else if (this._handshakeSequence && sequence.constructor === Sequences.Handshake) { - err = new Error(prefixAfter + 'already enqueuing a Handshake.'); + err = new Error(prefix + ' after already enqueuing a Handshake.'); err.code = 'PROTOCOL_ENQUEUE_HANDSHAKE_TWICE'; - } else if (!this._handshakeSequence && sequence.constructor === Sequences.ChangeUser) { - err = new Error(prefixBefore + 'a Handshake.'); - err.code = 'PROTOCOL_ENQUEUE_BEFORE_HANDSHAKE'; } else { return true; }