Skip to content

Commit a2bc597

Browse files
author
Ruben Bridgewater
committed
Add simicolons
This is just a style change
1 parent 1f9e536 commit a2bc597

File tree

8 files changed

+37
-33
lines changed

8 files changed

+37
-33
lines changed

diff_multi_bench_output.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ before_lines.forEach(function(b, i) {
4949
var isNaN = !num && num !== 0;
5050
return !isNaN;
5151
});
52-
if (ops.length != 2) return
52+
if (ops.length != 2) return;
5353

5454
var delta = ops[1] - ops[0];
5555
var pct = ((delta / ops[0]) * 100).toPrecision(3);

examples/extend.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ redis.RedisClient.prototype.parse_info = function (callback) {
1616
obj[parts[0]] = parts[1];
1717
}
1818
});
19-
callback(obj)
19+
callback(obj);
2020
});
2121
};
2222

examples/file.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ var redis = require("redis"),
1313

1414
// Read a file from fs, store it in Redis, get it back from Redis, write it back to fs.
1515
fs.readFile(filename, function (err, data) {
16-
if (err) throw err
16+
if (err) throw err;
1717
console.log("Read " + data.length + " bytes from filesystem.");
18-
18+
1919
client.set(filename, data, redis.print); // set entire file
2020
client.get(filename, function (err, reply) { // get entire file
2121
if (err) {
2222
console.log("Get error: " + err);
2323
} else {
2424
fs.writeFile("duplicate_" + filename, reply, function (err) {
2525
if (err) {
26-
console.log("Error on write: " + err)
26+
console.log("Error on write: " + err);
2727
} else {
2828
console.log("File written.");
2929
}

examples/unix_socket.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
'use strict';
2+
13
var redis = require("redis"),
24
client = redis.createClient("/tmp/redis.sock"),
35
profiler = require("v8-profiler");
46

57
client.on("connect", function () {
6-
console.log("Got Unix socket connection.")
8+
console.log("Got Unix socket connection.");
79
});
810

911
client.on("error", function (err) {

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ var net = require("net"),
1717
// can set this to true to enable for all connections
1818
exports.debug_mode = false;
1919

20-
var arraySlice = Array.prototype.slice
20+
var arraySlice = Array.prototype.slice;
2121
function trace() {
2222
if (!exports.debug_mode) return;
23-
console.log.apply(null, arraySlice.call(arguments))
23+
console.log.apply(null, arraySlice.call(arguments));
2424
}
2525

2626
// hiredis might not be installed
@@ -141,7 +141,7 @@ RedisClient.prototype.unref = function () {
141141
trace("Not connected yet, will unref later");
142142
this.once("connect", function () {
143143
this.unref();
144-
})
144+
});
145145
}
146146
};
147147

@@ -219,7 +219,7 @@ RedisClient.prototype.do_auth = function () {
219219
}, 2000); // TODO - magic number alert
220220
return;
221221
} else if (err.toString().match("no password is set")) {
222-
console.log("Warning: Redis server does not require a password, but a password was supplied.")
222+
console.log("Warning: Redis server does not require a password, but a password was supplied.");
223223
err = null;
224224
res = "OK";
225225
} else {
@@ -1265,7 +1265,7 @@ var createClient_unix = function(path, options){
12651265
redis_client.address = path;
12661266

12671267
return redis_client;
1268-
}
1268+
};
12691269

12701270
var createClient_tcp = function (port_arg, host_arg, options) {
12711271
var cnxOptions = {

test/queue-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ module.exports = function (tests, next) {
1111
q.push(3);
1212
assert.equal(q.length, 2);
1313
return next();
14-
}
14+
};
1515

1616
tests.shift = function () {
1717
assert.equal(q.shift(), 'a');
1818
return next();
19-
}
19+
};
2020

2121
tests.forEach = function () {
2222
q.forEach(function (v) {
2323
assert.equal(v, 3);
2424
});
2525

2626
return next();
27-
}
27+
};
2828

2929
tests.forEachWithScope = function () {
3030
q.forEach(function (v) {
@@ -33,5 +33,5 @@ module.exports = function (tests, next) {
3333
}, {foo: 'bar'});
3434

3535
return next();
36-
}
37-
}
36+
};
37+
};

test/test-unref.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
var redis = require("../")
1+
'use strict';
2+
3+
var redis = require("../");
24
//redis.debug_mode = true
35
var PORT = process.argv[2] || 6379;
46
var HOST = process.argv[3] || '127.0.0.1';
57

6-
var c = redis.createClient(PORT, HOST)
7-
c.unref()
8+
var c = redis.createClient(PORT, HOST);
9+
c.unref();
810
c.info(function (err, reply) {
9-
if (err) process.exit(-1)
10-
if (!reply.length) process.exit(-1)
11-
process.stdout.write(reply.length.toString())
12-
})
11+
if (err) process.exit(-1);
12+
if (!reply.length) process.exit(-1);
13+
process.stdout.write(reply.length.toString());
14+
});

test/test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ tests.IPV4 = function () {
137137
console.error("client: " + err.stack);
138138
process.exit();
139139
});
140-
}
140+
};
141141

142142
tests.IPV6 = function () {
143143
if (!server_version_at_least(client, [2, 8, 0])) {
@@ -163,7 +163,7 @@ tests.IPV6 = function () {
163163
console.error("client: " + err.stack);
164164
process.exit();
165165
});
166-
}
166+
};
167167

168168
tests.UNIX_SOCKET = function () {
169169
var unixClient = redis.createClient('/tmp/redis.sock', { parser: parser });
@@ -189,7 +189,7 @@ tests.UNIX_SOCKET = function () {
189189
console.error("client: " + err.stack);
190190
process.exit();
191191
});
192-
}
192+
};
193193

194194
tests.FLUSHDB = function () {
195195
var name = "FLUSHDB";
@@ -1543,7 +1543,7 @@ tests.HGETALL_MESSAGE = function () {
15431543
client.hgetall("msg_test", function (err, obj) {
15441544
assert.strictEqual(null, err, name + " result sent back unexpected error: " + err);
15451545
assert.strictEqual(1, Object.keys(obj).length, name);
1546-
assert.strictEqual(obj.message, "hello")
1546+
assert.strictEqual(obj.message, "hello");
15471547
next(name);
15481548
});
15491549
};
@@ -2178,8 +2178,8 @@ tests.ENABLE_OFFLINE_QUEUE_FALSE = function () {
21782178
// ignore, see above
21792179
});
21802180
assert.throws(function () {
2181-
cli.set(name, name)
2182-
})
2181+
cli.set(name, name);
2182+
});
21832183
assert.doesNotThrow(function () {
21842184
cli.set(name, name, function (err) {
21852185
// should callback with an error
@@ -2205,7 +2205,7 @@ tests.SLOWLOG = function () {
22052205
client.config("set", "slowlog-log-slower-than", 10000, require_string("OK", name));
22062206
next(name);
22072207
});
2208-
}
2208+
};
22092209

22102210
tests.DOMAIN = function () {
22112211
var name = "DOMAIN";
@@ -2323,9 +2323,9 @@ tests.unref = function () {
23232323
var external = fork("./test/test-unref.js");
23242324
var done = false;
23252325
external.on("close", function (code) {
2326-
assert(code == 0, "test-unref.js failed");
2326+
assert(code === 0, "test-unref.js failed");
23272327
done = true;
2328-
})
2328+
});
23292329
setTimeout(function () {
23302330
if (!done) {
23312331
external.kill();
@@ -2336,7 +2336,7 @@ tests.unref = function () {
23362336
};
23372337

23382338
// starting to split tests into multiple files.
2339-
require('./queue-test')(tests, next)
2339+
require('./queue-test')(tests, next);
23402340

23412341
all_tests = Object.keys(tests);
23422342
all_start = new Date();

0 commit comments

Comments
 (0)