Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code and learn rollup 3 #23653

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,9 @@
const { kExpandStackSymbol } = NativeModule.require('internal/util');
if (typeof er[kExpandStackSymbol] === 'function')
er[kExpandStackSymbol]();
} catch (er) {}
} catch {
// Nothing to be done about it at this point.
}
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ exports.checkServerIdentity = function checkServerIdentity(hostname, cert) {
let uri;
try {
uri = new URL(name.slice(4));
} catch (err) {
} catch {
uri = url.parse(name.slice(4));
if (!urlWarningEmitted && !process.noDeprecation) {
urlWarningEmitted = true;
Expand Down
2 changes: 1 addition & 1 deletion test/addons/load-long-path/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
const common = require('../../common');
if (common.isWOW64)
if (common.isWindows && (process.env.PROCESSOR_ARCHITEW6432 !== undefined))
common.skip('doesn\'t work on WOW64');

const fs = require('fs');
Expand Down
5 changes: 0 additions & 5 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,6 @@ Platform check for SunOS.

Platform check for Windows.

### isWOW64
* [<boolean>]

Platform check for Windows 32-bit on Windows 64-bit.

### localhostIPv4
* [<string>]

Expand Down
2 changes: 0 additions & 2 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const isMainThread = (() => {
})();

const isWindows = process.platform === 'win32';
const isWOW64 = isWindows && (process.env.PROCESSOR_ARCHITEW6432 !== undefined);
const isAIX = process.platform === 'aix';
const isLinuxPPCBE = (process.platform === 'linux') &&
(process.arch === 'ppc64') &&
Expand Down Expand Up @@ -721,7 +720,6 @@ module.exports = {
isOSX,
isSunOS,
isWindows,
isWOW64,
localIPv6Hosts,
mustCall,
mustCallAsync,
Expand Down
2 changes: 0 additions & 2 deletions test/common/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import common from './index.js';
const {
isMainThread,
isWindows,
isWOW64,
isAIX,
isLinuxPPCBE,
isSunOS,
Expand Down Expand Up @@ -54,7 +53,6 @@ const {
export {
isMainThread,
isWindows,
isWOW64,
isAIX,
isLinuxPPCBE,
isSunOS,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-failed-alloc-typed-arrays.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for (const allocator of allocators) {
// These allocations are known to fail. If they do,
// Uint32Array should still produce a zeroed out result.
allocator(size);
} catch (e) {
} catch {
assert.deepStrictEqual(new Uint32Array(10), zeroArray);
}
}
Expand Down
12 changes: 6 additions & 6 deletions test/parallel/test-dgram-send-bad-arguments.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ const buf = Buffer.from('test');
const host = '127.0.0.1';
const sock = dgram.createSocket('udp4');

assert.throws(function() {
assert.throws(() => {
sock.send();
}, TypeError); // First argument should be a buffer.

// send(buf, offset, length, port, host)
assert.throws(function() { sock.send(buf, 1, 1, -1, host); }, RangeError);
assert.throws(function() { sock.send(buf, 1, 1, 0, host); }, RangeError);
assert.throws(function() { sock.send(buf, 1, 1, 65536, host); }, RangeError);
assert.throws(() => { sock.send(buf, 1, 1, -1, host); }, RangeError);
assert.throws(() => { sock.send(buf, 1, 1, 0, host); }, RangeError);
assert.throws(() => { sock.send(buf, 1, 1, 65536, host); }, RangeError);

// send(buf, port, host)
assert.throws(function() { sock.send(23, 12345, host); }, TypeError);
assert.throws(() => { sock.send(23, 12345, host); }, TypeError);

// send([buf1, ..], port, host)
assert.throws(function() { sock.send([buf, 23], 12345, host); }, TypeError);
assert.throws(() => { sock.send([buf, 23], 12345, host); }, TypeError);
2 changes: 1 addition & 1 deletion test/parallel/test-http2-respond-file-fd-invalid.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ server.on('stream', (stream) => {
// Get first known bad file descriptor.
try {
while (fs.fstatSync(++fd));
} catch (e) {
} catch {
// do nothing; we now have an invalid fd
}

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-readline-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ function isWarned(emitter) {
});
try {
fi.emit('data', 'fooX');
} catch (e) { }
} catch { }
fi.emit('data', 'bar');
assert.strictEqual(keys.join(''), 'fooXbar');
rli.close();
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-inspector-scriptparsed-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async function runTests() {
await session.waitForBreakOnLine(0, 'evalmachine.<anonymous>');

await session.runToCompletion();
assert.strictEqual(0, (await instance.expectShutdown()).exitCode);
assert.strictEqual((await instance.expectShutdown()).exitCode, 0);
}

runTests();
6 changes: 3 additions & 3 deletions test/sequential/test-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const tcp = net.Server(common.mustCall((s) => {
s.on('data', (d) => {
tcpLengthSeen += d.length;
for (let j = 0; j < d.length; j++) {
assert.strictEqual(buffer[i], d[j]);
assert.strictEqual(d[j], buffer[i]);
i++;
}
});
Expand Down Expand Up @@ -103,7 +103,7 @@ function startClient() {
}, common.mustCall((res) => {
res.setEncoding('utf8');
res.on('data', common.mustCall((string) => {
assert.strictEqual('thanks', string);
assert.strictEqual(string, 'thanks');
gotThanks = true;
}));
}));
Expand All @@ -113,5 +113,5 @@ function startClient() {

process.on('exit', () => {
assert.ok(gotThanks);
assert.strictEqual(bufferSize, tcpLengthSeen);
assert.strictEqual(tcpLengthSeen, bufferSize);
});