lib,benchmark,test: implement consistent braces
This change is in preparation for lint-enforced brace style. PR-URL: https://github.com/nodejs/node/pull/7630 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
This commit is contained in:
parent
55250b83aa
commit
5b63d48e9e
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
if (process.argv[2] === 'child')
|
if (process.argv[2] === 'child') {
|
||||||
{
|
|
||||||
const len = +process.argv[3];
|
const len = +process.argv[3];
|
||||||
const msg = `"${'.'.repeat(len)}"`;
|
const msg = `"${'.'.repeat(len)}"`;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -803,9 +803,11 @@ Readable.prototype.wrap = function(stream) {
|
|||||||
// important when wrapping filters and duplexes.
|
// important when wrapping filters and duplexes.
|
||||||
for (var i in stream) {
|
for (var i in stream) {
|
||||||
if (this[i] === undefined && typeof stream[i] === 'function') {
|
if (this[i] === undefined && typeof stream[i] === 'function') {
|
||||||
this[i] = function(method) { return function() {
|
this[i] = function(method) {
|
||||||
return stream[method].apply(stream, arguments);
|
return function() {
|
||||||
}; }(i);
|
return stream[method].apply(stream, arguments);
|
||||||
|
};
|
||||||
|
}(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,8 +622,7 @@ Module._preloadModules = function(requests) {
|
|||||||
var parent = new Module('internal/preload', null);
|
var parent = new Module('internal/preload', null);
|
||||||
try {
|
try {
|
||||||
parent.paths = Module._nodeModulePaths(process.cwd());
|
parent.paths = Module._nodeModulePaths(process.cwd());
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
if (e.code !== 'ENOENT') {
|
if (e.code !== 'ENOENT') {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
@ -1159,8 +1159,7 @@ function createServerHandle(address, port, addressType, fd) {
|
|||||||
if (typeof fd === 'number' && fd >= 0) {
|
if (typeof fd === 'number' && fd >= 0) {
|
||||||
try {
|
try {
|
||||||
handle = createHandle(fd);
|
handle = createHandle(fd);
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
// Not a fd we can listen on. This will trigger an error.
|
// Not a fd we can listen on. This will trigger an error.
|
||||||
debug('listen invalid fd=' + fd + ': ' + e.message);
|
debug('listen invalid fd=' + fd + ': ' + e.message);
|
||||||
return uv.UV_EINVAL;
|
return uv.UV_EINVAL;
|
||||||
|
@ -96,8 +96,7 @@ if (process.argv[2] !== 'child') {
|
|||||||
//all child process are listening, so start sending
|
//all child process are listening, so start sending
|
||||||
sendSocket.sendNext();
|
sendSocket.sendNext();
|
||||||
}
|
}
|
||||||
}
|
} else if (msg.message) {
|
||||||
else if (msg.message) {
|
|
||||||
worker.messagesReceived.push(msg.message);
|
worker.messagesReceived.push(msg.message);
|
||||||
|
|
||||||
if (worker.messagesReceived.length === messages.length) {
|
if (worker.messagesReceived.length === messages.length) {
|
||||||
|
@ -12,13 +12,11 @@ if (process.env.FORK) {
|
|||||||
assert.equal(process.argv[0], copyPath);
|
assert.equal(process.argv[0], copyPath);
|
||||||
process.send(msg);
|
process.send(msg);
|
||||||
process.exit();
|
process.exit();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
common.refreshTmpDir();
|
common.refreshTmpDir();
|
||||||
try {
|
try {
|
||||||
fs.unlinkSync(copyPath);
|
fs.unlinkSync(copyPath);
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
if (e.code !== 'ENOENT') throw e;
|
if (e.code !== 'ENOENT') throw e;
|
||||||
}
|
}
|
||||||
fs.writeFileSync(copyPath, fs.readFileSync(nodePath));
|
fs.writeFileSync(copyPath, fs.readFileSync(nodePath));
|
||||||
|
@ -49,14 +49,12 @@ function worker() {
|
|||||||
if (n === 1) {
|
if (n === 1) {
|
||||||
assert.equal(msg, 'one');
|
assert.equal(msg, 'one');
|
||||||
assert.equal(handle, undefined);
|
assert.equal(handle, undefined);
|
||||||
}
|
} else if (n === 2) {
|
||||||
else if (n === 2) {
|
|
||||||
assert.equal(msg, 'two');
|
assert.equal(msg, 'two');
|
||||||
assert.equal(typeof handle, 'object'); // Also matches null, therefore...
|
assert.equal(typeof handle, 'object'); // Also matches null, therefore...
|
||||||
assert.ok(handle); // also check that it's truthy.
|
assert.ok(handle); // also check that it's truthy.
|
||||||
handle.close();
|
handle.close();
|
||||||
}
|
} else if (n === 3) {
|
||||||
else if (n === 3) {
|
|
||||||
assert.equal(msg, 'three');
|
assert.equal(msg, 'three');
|
||||||
assert.equal(handle, undefined);
|
assert.equal(handle, undefined);
|
||||||
process.exit();
|
process.exit();
|
||||||
|
@ -18,9 +18,7 @@ if (cluster.isWorker) {
|
|||||||
http.Server(function() {
|
http.Server(function() {
|
||||||
|
|
||||||
}).listen(common.PORT, '127.0.0.1');
|
}).listen(common.PORT, '127.0.0.1');
|
||||||
}
|
} else if (cluster.isMaster) {
|
||||||
|
|
||||||
else if (cluster.isMaster) {
|
|
||||||
|
|
||||||
var checks = {
|
var checks = {
|
||||||
cluster: {
|
cluster: {
|
||||||
|
@ -18,8 +18,7 @@ if (cluster.isMaster) {
|
|||||||
cluster.fork().on('exit', common.mustCall(function(exitCode) {
|
cluster.fork().on('exit', common.mustCall(function(exitCode) {
|
||||||
assert.equal(exitCode, 0);
|
assert.equal(exitCode, 0);
|
||||||
}));
|
}));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
var s = net.createServer(common.fail);
|
var s = net.createServer(common.fail);
|
||||||
s.listen(42, common.fail.bind(null, 'listen should have failed'));
|
s.listen(42, common.fail.bind(null, 'listen should have failed'));
|
||||||
s.on('error', common.mustCall(function(err) {
|
s.on('error', common.mustCall(function(err) {
|
||||||
|
@ -64,8 +64,7 @@ if (!id) {
|
|||||||
process.on('exit', function() {
|
process.on('exit', function() {
|
||||||
assert(ok);
|
assert(ok);
|
||||||
});
|
});
|
||||||
}
|
} else if (id === 'one') {
|
||||||
else if (id === 'one') {
|
|
||||||
if (cluster.isMaster) return startWorker();
|
if (cluster.isMaster) return startWorker();
|
||||||
|
|
||||||
http.createServer(common.fail).listen(common.PORT, function() {
|
http.createServer(common.fail).listen(common.PORT, function() {
|
||||||
@ -75,8 +74,7 @@ else if (id === 'one') {
|
|||||||
process.on('message', function(m) {
|
process.on('message', function(m) {
|
||||||
if (m === 'QUIT') process.exit();
|
if (m === 'QUIT') process.exit();
|
||||||
});
|
});
|
||||||
}
|
} else if (id === 'two') {
|
||||||
else if (id === 'two') {
|
|
||||||
if (cluster.isMaster) return startWorker();
|
if (cluster.isMaster) return startWorker();
|
||||||
|
|
||||||
let ok = false;
|
let ok = false;
|
||||||
@ -96,8 +94,7 @@ else if (id === 'two') {
|
|||||||
ok = true;
|
ok = true;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
assert(0); // bad command line argument
|
assert(0); // bad command line argument
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,8 +21,7 @@ if (id === 'undefined') {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
} else if (id === 'worker') {
|
||||||
else if (id === 'worker') {
|
|
||||||
let server = net.createServer(common.fail);
|
let server = net.createServer(common.fail);
|
||||||
server.listen(common.PORT, common.fail);
|
server.listen(common.PORT, common.fail);
|
||||||
server.on('error', common.mustCall(function(e) {
|
server.on('error', common.mustCall(function(e) {
|
||||||
@ -36,7 +35,6 @@ else if (id === 'worker') {
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
assert(0); // Bad argument.
|
assert(0); // Bad argument.
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ if (cluster.isMaster) {
|
|||||||
// ensure that the 'listening' handler has been called
|
// ensure that the 'listening' handler has been called
|
||||||
assert(port);
|
assert(port);
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
net.createServer(common.fail).listen(0);
|
net.createServer(common.fail).listen(0);
|
||||||
}
|
}
|
||||||
|
@ -40,9 +40,7 @@ if (cluster.isWorker) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
server.listen(common.PORT, '127.0.0.1');
|
server.listen(common.PORT, '127.0.0.1');
|
||||||
}
|
} else if (cluster.isMaster) {
|
||||||
|
|
||||||
else if (cluster.isMaster) {
|
|
||||||
|
|
||||||
var checks = {
|
var checks = {
|
||||||
global: {
|
global: {
|
||||||
|
@ -14,8 +14,7 @@ if (cluster.isMaster) {
|
|||||||
process.on('exit', function() {
|
process.on('exit', function() {
|
||||||
assert.equal(worker, null);
|
assert.equal(worker, null);
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// listen() without port should not trigger a libuv assert
|
// listen() without port should not trigger a libuv assert
|
||||||
net.createServer(common.fail).listen(process.exit);
|
net.createServer(common.fail).listen(process.exit);
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,7 @@ if (cluster.isMaster) {
|
|||||||
server.close();
|
server.close();
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
var s = net.createServer(common.fail);
|
var s = net.createServer(common.fail);
|
||||||
s.listen(common.PORT, common.fail.bind(null, 'listen should have failed'));
|
s.listen(common.PORT, common.fail.bind(null, 'listen should have failed'));
|
||||||
s.on('error', common.mustCall(function(err) {
|
s.on('error', common.mustCall(function(err) {
|
||||||
|
@ -20,8 +20,7 @@ if (cluster.isMaster) {
|
|||||||
cluster.fork().on('exit', common.mustCall(function(exitCode) {
|
cluster.fork().on('exit', common.mustCall(function(exitCode) {
|
||||||
assert.equal(exitCode, 0);
|
assert.equal(exitCode, 0);
|
||||||
}));
|
}));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
var s = net.createServer(common.fail);
|
var s = net.createServer(common.fail);
|
||||||
s.listen(42, common.fail.bind(null, 'listen should have failed'));
|
s.listen(42, common.fail.bind(null, 'listen should have failed'));
|
||||||
s.on('error', common.mustCall(function(err) {
|
s.on('error', common.mustCall(function(err) {
|
||||||
|
@ -23,8 +23,7 @@ if (isTestRunner) {
|
|||||||
master.on('exit', function(code) {
|
master.on('exit', function(code) {
|
||||||
exitCode = code;
|
exitCode = code;
|
||||||
});
|
});
|
||||||
}
|
} else if (cluster.isMaster) {
|
||||||
else if (cluster.isMaster) {
|
|
||||||
process.on('uncaughtException', function() {
|
process.on('uncaughtException', function() {
|
||||||
process.nextTick(function() {
|
process.nextTick(function() {
|
||||||
process.exit(MAGIC_EXIT_CODE);
|
process.exit(MAGIC_EXIT_CODE);
|
||||||
@ -33,7 +32,6 @@ else if (cluster.isMaster) {
|
|||||||
|
|
||||||
cluster.fork();
|
cluster.fork();
|
||||||
throw new Error('kill master');
|
throw new Error('kill master');
|
||||||
}
|
} else { // worker
|
||||||
else { // worker
|
|
||||||
process.exit();
|
process.exit();
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,7 @@ var cluster = require('cluster');
|
|||||||
|
|
||||||
if (!cluster.isMaster) {
|
if (!cluster.isMaster) {
|
||||||
process.exit(42);
|
process.exit(42);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
var seenExit = 0;
|
var seenExit = 0;
|
||||||
var seenDeath = 0;
|
var seenDeath = 0;
|
||||||
var worker = cluster.fork();
|
var worker = cluster.fork();
|
||||||
|
@ -362,8 +362,7 @@ for (var i in TEST_CASES) {
|
|||||||
(function() {
|
(function() {
|
||||||
if (!test.password) return;
|
if (!test.password) return;
|
||||||
if (common.hasFipsCrypto) {
|
if (common.hasFipsCrypto) {
|
||||||
assert.throws(function()
|
assert.throws(() => { crypto.createCipher(test.algo, test.password); },
|
||||||
{ crypto.createCipher(test.algo, test.password); },
|
|
||||||
/not supported in FIPS mode/);
|
/not supported in FIPS mode/);
|
||||||
} else {
|
} else {
|
||||||
var encrypt = crypto.createCipher(test.algo, test.password);
|
var encrypt = crypto.createCipher(test.algo, test.password);
|
||||||
@ -383,8 +382,7 @@ for (var i in TEST_CASES) {
|
|||||||
(function() {
|
(function() {
|
||||||
if (!test.password) return;
|
if (!test.password) return;
|
||||||
if (common.hasFipsCrypto) {
|
if (common.hasFipsCrypto) {
|
||||||
assert.throws(function()
|
assert.throws(() => { crypto.createDecipher(test.algo, test.password); },
|
||||||
{ crypto.createDecipher(test.algo, test.password); },
|
|
||||||
/not supported in FIPS mode/);
|
/not supported in FIPS mode/);
|
||||||
} else {
|
} else {
|
||||||
var decrypt = crypto.createDecipher(test.algo, test.password);
|
var decrypt = crypto.createDecipher(test.algo, test.password);
|
||||||
@ -415,9 +413,9 @@ for (var i in TEST_CASES) {
|
|||||||
'ipxp9a6i1Mb4USb4', '6fKjEjR3Vl30EUYC');
|
'ipxp9a6i1Mb4USb4', '6fKjEjR3Vl30EUYC');
|
||||||
encrypt.update('blah', 'ascii');
|
encrypt.update('blah', 'ascii');
|
||||||
encrypt.final();
|
encrypt.final();
|
||||||
assert.throws(function() { encrypt.getAuthTag(); }, / state/);
|
assert.throws(() => { encrypt.getAuthTag(); }, / state/);
|
||||||
assert.throws(function() {
|
assert.throws(() => { encrypt.setAAD(Buffer.from('123', 'ascii')); },
|
||||||
encrypt.setAAD(Buffer.from('123', 'ascii')); }, / state/);
|
/ state/);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
@ -432,8 +430,8 @@ for (var i in TEST_CASES) {
|
|||||||
// trying to set tag on encryption object:
|
// trying to set tag on encryption object:
|
||||||
var encrypt = crypto.createCipheriv(test.algo,
|
var encrypt = crypto.createCipheriv(test.algo,
|
||||||
Buffer.from(test.key, 'hex'), Buffer.from(test.iv, 'hex'));
|
Buffer.from(test.key, 'hex'), Buffer.from(test.iv, 'hex'));
|
||||||
assert.throws(function() {
|
assert.throws(() => { encrypt.setAuthTag(Buffer.from(test.tag, 'hex')); },
|
||||||
encrypt.setAuthTag(Buffer.from(test.tag, 'hex')); }, / state/);
|
/ state/);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
@ -39,12 +39,10 @@ proc.stdout.on('data', (data) => {
|
|||||||
stdout.includes('> 4') && nextCount < 4) {
|
stdout.includes('> 4') && nextCount < 4) {
|
||||||
nextCount++;
|
nextCount++;
|
||||||
proc.stdin.write('n\n');
|
proc.stdin.write('n\n');
|
||||||
}
|
} else if (stdout.includes('{ a: \'b\' }')) {
|
||||||
else if (stdout.includes('{ a: \'b\' }')) {
|
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
proc.stdin.write('.exit\n');
|
proc.stdin.write('.exit\n');
|
||||||
}
|
} else if (stdout.includes('program terminated')) {
|
||||||
else if (stdout.includes('program terminated')) {
|
|
||||||
// Catch edge case present in v4.x
|
// Catch edge case present in v4.x
|
||||||
// process will terminate after call to util.inspect
|
// process will terminate after call to util.inspect
|
||||||
common.fail('the program should not terminate');
|
common.fail('the program should not terminate');
|
||||||
|
@ -8,8 +8,7 @@ try {
|
|||||||
// should throw ENOENT, not EBADF
|
// should throw ENOENT, not EBADF
|
||||||
// see https://github.com/joyent/node/pull/1228
|
// see https://github.com/joyent/node/pull/1228
|
||||||
fs.openSync('/path/to/file/that/does/not/exist', 'r');
|
fs.openSync('/path/to/file/that/does/not/exist', 'r');
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
assert.equal(e.code, 'ENOENT');
|
assert.equal(e.code, 'ENOENT');
|
||||||
caughtException = true;
|
caughtException = true;
|
||||||
}
|
}
|
||||||
|
@ -57,8 +57,7 @@ function asynctest(testBlock, args, callback, assertBlock) {
|
|||||||
if (assertBlock) {
|
if (assertBlock) {
|
||||||
try {
|
try {
|
||||||
ignoreError = assertBlock.apply(assertBlock, arguments);
|
ignoreError = assertBlock.apply(assertBlock, arguments);
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
err = e;
|
err = e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,7 @@ if (process.env.NODE_TEST_FORK_PORT) {
|
|||||||
}, process.exit);
|
}, process.exit);
|
||||||
req.write('BAM');
|
req.write('BAM');
|
||||||
req.end();
|
req.end();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
var server = http.createServer(function(req, res) {
|
var server = http.createServer(function(req, res) {
|
||||||
res.writeHead(200, {'Content-Length': '42'});
|
res.writeHead(200, {'Content-Length': '42'});
|
||||||
req.pipe(res);
|
req.pipe(res);
|
||||||
|
@ -40,8 +40,7 @@ process.on('uncaughtException', function() {
|
|||||||
if (!exceptionHandled) {
|
if (!exceptionHandled) {
|
||||||
exceptionHandled = true;
|
exceptionHandled = true;
|
||||||
order.push('B');
|
order.push('B');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// If we get here then the first process.nextTick got called twice
|
// If we get here then the first process.nextTick got called twice
|
||||||
order.push('OOPS!');
|
order.push('OOPS!');
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@ if (process.argv[2] !== 'child') {
|
|||||||
process.on('exit', function() {
|
process.on('exit', function() {
|
||||||
assert.equal(childArgv0, process.execPath);
|
assert.equal(childArgv0, process.execPath);
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
process.stdout.write(process.argv[0]);
|
process.stdout.write(process.argv[0]);
|
||||||
}
|
}
|
||||||
|
@ -42,14 +42,18 @@ assert.throws(function() { process.cpuUsage({ user: null, system: 'c' }); });
|
|||||||
assert.throws(function() { process.cpuUsage({ user: 'd', system: null }); });
|
assert.throws(function() { process.cpuUsage({ user: 'd', system: null }); });
|
||||||
assert.throws(function() { process.cpuUsage({ user: -1, system: 2 }); });
|
assert.throws(function() { process.cpuUsage({ user: -1, system: 2 }); });
|
||||||
assert.throws(function() { process.cpuUsage({ user: 3, system: -2 }); });
|
assert.throws(function() { process.cpuUsage({ user: 3, system: -2 }); });
|
||||||
assert.throws(function() { process.cpuUsage({
|
assert.throws(function() {
|
||||||
user: Number.POSITIVE_INFINITY,
|
process.cpuUsage({
|
||||||
system: 4
|
user: Number.POSITIVE_INFINITY,
|
||||||
});});
|
system: 4
|
||||||
assert.throws(function() { process.cpuUsage({
|
});
|
||||||
user: 5,
|
});
|
||||||
system: Number.NEGATIVE_INFINITY
|
assert.throws(function() {
|
||||||
});});
|
process.cpuUsage({
|
||||||
|
user: 5,
|
||||||
|
system: Number.NEGATIVE_INFINITY
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Ensure that the return value is the expected shape.
|
// Ensure that the return value is the expected shape.
|
||||||
function validateResult(result) {
|
function validateResult(result) {
|
||||||
|
@ -11,8 +11,7 @@ putIn.write = function(data) {
|
|||||||
// give a false negative. Don't throw, just print and exit.
|
// give a false negative. Don't throw, just print and exit.
|
||||||
if (data === 'OK\n') {
|
if (data === 'OK\n') {
|
||||||
console.log('ok');
|
console.log('ok');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
console.error(data);
|
console.error(data);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
@ -32,8 +32,7 @@ console.error('test runInContext signature');
|
|||||||
var gh1140Exception;
|
var gh1140Exception;
|
||||||
try {
|
try {
|
||||||
vm.runInContext('throw new Error()', context, 'expected-filename.js');
|
vm.runInContext('throw new Error()', context, 'expected-filename.js');
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
gh1140Exception = e;
|
gh1140Exception = e;
|
||||||
assert.ok(/expected-filename/.test(e.stack),
|
assert.ok(/expected-filename/.test(e.stack),
|
||||||
'expected appearance of filename in Error stack');
|
'expected appearance of filename in Error stack');
|
||||||
|
@ -11,8 +11,7 @@ var nevents = 0;
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
fs.unlinkSync(FILENAME);
|
fs.unlinkSync(FILENAME);
|
||||||
}
|
} catch (e) {
|
||||||
catch (e) {
|
|
||||||
// swallow
|
// swallow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,15 +44,13 @@ var timeToQuit = Date.now() + 8e3; //Test during no more than this seconds.
|
|||||||
if (bufPool.push(nuBuf) > 100) {
|
if (bufPool.push(nuBuf) > 100) {
|
||||||
bufPool.length = 0;
|
bufPool.length = 0;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
throw new Error("Buffer GC'ed test -> FAIL");
|
throw new Error("Buffer GC'ed test -> FAIL");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Date.now() < timeToQuit) {
|
if (Date.now() < timeToQuit) {
|
||||||
process.nextTick(main);
|
process.nextTick(main);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
tail.kill();
|
tail.kill();
|
||||||
console.log("Buffer GC'ed test -> PASS (OK)");
|
console.log("Buffer GC'ed test -> PASS (OK)");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user