Skip to content

Commit

Permalink
lint: remove unreachable conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Jul 29, 2017
1 parent d9170cc commit 3630d80
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lib/protocol/Protocol.js
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3630d80

Please sign in to comment.