1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00

Remove jshint comments and update istanbul comments

This commit is contained in:
Ruben Bridgewater
2016-04-21 02:49:06 +02:00
parent 625f14e6ba
commit f7c4d131be
5 changed files with 9 additions and 8 deletions

View File

@@ -51,7 +51,7 @@ function RedisClient (options, stream) {
var cnx_options = {};
var self = this;
/* istanbul ignore next: travis does not work with stunnel atm. Therefore the tls tests are skipped on travis */
for (var tls_option in options.tls) { // jshint ignore: line
for (var tls_option in options.tls) {
cnx_options[tls_option] = options.tls[tls_option];
// Copy the tls options into the general options to make sure the address is set right
if (tls_option === 'port' || tls_option === 'host' || tls_option === 'path' || tls_option === 'family') {
@@ -102,7 +102,7 @@ function RedisClient (options, stream) {
if (options.socket_keepalive === undefined) {
options.socket_keepalive = true;
}
for (var command in options.rename_commands) { // jshint ignore: line
for (var command in options.rename_commands) {
options.rename_commands[command.toLowerCase()] = options.rename_commands[command];
}
options.return_buffers = !!options.return_buffers;
@@ -438,7 +438,7 @@ RedisClient.prototype.on_ready = function () {
}
};
debug('Sending pub/sub on_ready commands');
for (var key in this.subscription_set) { // jshint ignore: line
for (var key in this.subscription_set) {
var command = key.slice(0, key.indexOf('_'));
var args = self.subscription_set[key];
self.internal_send_command(command, [args], callback);
@@ -934,6 +934,7 @@ RedisClient.prototype.internal_send_command = function (command, args, callback,
}
// Handle `CLIENT REPLY ON|OFF|SKIP`
// This has to be checked after call_on_write
/* istanbul ignore else: TODO: Remove this as soon as we test Redis 3.2 on travis */
if (this.reply === 'ON') {
this.command_queue.push(command_obj);
} else {

View File

@@ -44,7 +44,7 @@ module.exports = function createClient (port_arg, host_arg, options) {
}
if (parsed.search !== '') {
var elem;
for (elem in parsed.query) { // jshint ignore: line
for (elem in parsed.query) {
// If options are passed twice, only the parsed options will be used
if (elem in options) {
if (options[elem] === parsed.query[elem]) {

View File

@@ -89,7 +89,7 @@ RedisClient.prototype.duplicate = function (options, callback) {
}
var existing_options = utils.clone(this.options);
options = utils.clone(options);
for (var elem in options) { // jshint ignore: line
for (var elem in options) {
existing_options[elem] = options[elem];
}
var client = new RedisClient(existing_options);

View File

@@ -147,7 +147,6 @@ function info_callback (self, callback) {
}
}
obj.versions = [];
/* istanbul ignore else: some redis servers do not send the version */
if (obj.redis_version) {
obj.redis_version.split('.').forEach(function (num) {
obj.versions.push(+num);
@@ -337,7 +336,7 @@ RedisClient.prototype.hmset = RedisClient.prototype.HMSET = function hmset () {
}
} else if (typeof arguments[1] === 'object' && (arguments.length === 2 || arguments.length === 3 && (typeof arguments[2] === 'function' || typeof arguments[2] === 'undefined'))) {
arr = [arguments[0]];
for (var field in arguments[1]) { // jshint ignore: line
for (var field in arguments[1]) {
arr.push(field, arguments[1][field]);
}
callback = arguments[2];
@@ -376,7 +375,7 @@ Multi.prototype.hmset = Multi.prototype.HMSET = function hmset () {
}
} else if (typeof arguments[1] === 'object' && (arguments.length === 2 || arguments.length === 3 && (typeof arguments[2] === 'function' || typeof arguments[2] === 'undefined'))) {
arr = [arguments[0]];
for (var field in arguments[1]) { // jshint ignore: line
for (var field in arguments[1]) {
arr.push(field, arguments[1][field]);
}
callback = arguments[2];

View File

@@ -94,6 +94,7 @@ function replyInOrder (self, callback, err, res, queue) {
// If the queue is explicitly passed, use that, otherwise fall back to the offline queue first,
// as there might be commands in both queues at the same time
var command_obj;
/* istanbul ignore if: TODO: Remove this as soon as we test Redis 3.2 on travis */
if (queue) {
command_obj = queue.peekBack();
} else {