Skip to content
Merged
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
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1449,15 +1449,15 @@ binary: $(BINARYTAR) ## Build release binary tarballs.
# Note: this is strictly for release builds on release machines only.
binary-upload: binary
ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
chmod 664 $(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz
scp -p $(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz
ssh $(STAGINGSERVER) "rclone copyto nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz $(CLOUDFLARE_BUCKET)/nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz"
ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz.done"
chmod 664 $(BINARYNAME).tar.gz
scp -p $(BINARYNAME).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(BINARYNAME).tar.gz
ssh $(STAGINGSERVER) "rclone copyto nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(BINARYNAME).tar.gz $(CLOUDFLARE_BUCKET)/nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(BINARYNAME).tar.gz"
ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(BINARYNAME).tar.gz.done"
ifeq ($(XZ), 1)
chmod 664 $(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz
scp -p $(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz
ssh $(STAGINGSERVER) "rclone copyto nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz $(CLOUDFLARE_BUCKET)/nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz"
ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz.done"
chmod 664 $(BINARYNAME).tar.xz
scp -p $(BINARYNAME).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(BINARYNAME).tar.xz
ssh $(STAGINGSERVER) "rclone copyto nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(BINARYNAME).tar.xz $(CLOUDFLARE_BUCKET)/nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(BINARYNAME).tar.xz"
ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(BINARYNAME).tar.xz.done"
endif

.PHONY: bench-all
Expand Down
1 change: 1 addition & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -3888,6 +3888,7 @@ one is included in the list below.
* `--experimental-package-map`
* `--experimental-print-required-tla`
* `--experimental-quic`
* `--experimental-repl-await`
* `--experimental-require-module`
* `--experimental-shadow-realm`
* `--experimental-specifier-resolution`
Expand Down
7 changes: 5 additions & 2 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,7 @@ const { glob } = require('node:fs/promises');
### `fsPromises.lchmod(path, mode)`

<!-- YAML
added: v10.0.0
deprecated: v10.0.0
-->

Expand Down Expand Up @@ -3666,7 +3667,8 @@ glob('**/*.js', (err, matches) => {
### `fs.lchmod(path, mode, callback)`

<!-- YAML
deprecated: v0.4.7
added: v0.5.0
deprecated: v0.5.0
changes:
- version: v18.0.0
pr-url: https://github.com/nodejs/node/pull/41678
Expand Down Expand Up @@ -6288,7 +6290,8 @@ console.log(globSync('**/*.js'));
### `fs.lchmodSync(path, mode)`

<!-- YAML
deprecated: v0.4.7
added: v0.5.0
deprecated: v0.5.0
-->

> Stability: 0 - Deprecated
Expand Down
2 changes: 1 addition & 1 deletion doc/contributing/using-internal-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ give users a place to go to easily look up the meaning of individual error
codes.

In case `make lint` fails to detect the new error codes added into `errors.md`,
the markdown linting cache must be cleaned with `make lint-md-clean`.
the markdown linting cache must be cleaned with `make lint-clean`.

## Testing new errors

Expand Down
2 changes: 2 additions & 0 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -2007,6 +2007,8 @@ one is included in the list below.
.It
\fB--experimental-quic\fR
.It
\fB--experimental-repl-await\fR
.It
\fB--experimental-require-module\fR
.It
\fB--experimental-shadow-realm\fR
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/webstreams/readablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const {
const {
validateAbortSignal,
validateBuffer,
validateNumber,
validateObject,
kValidateObjectAllowObjects,
kValidateObjectAllowObjectsAndNull,
Expand Down Expand Up @@ -1086,8 +1087,7 @@ class ReadableStreamBYOBReader {
// detached, but there's no API available to use to check that.

const min = options?.min ?? 1;
if (typeof min !== 'number')
throw new ERR_INVALID_ARG_TYPE('options.min', 'number', min);
validateNumber(min, 'options.min');
if (!NumberIsInteger(min))
throw new ERR_INVALID_ARG_VALUE('options.min', min, 'must be an integer');
if (min <= 0)
Expand Down
4 changes: 2 additions & 2 deletions onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ needs to be pointed out separately during the onboarding.
including accommodations, transportation, and visa fees (even in case the visa
is denied) if needed. Check out the [summit](https://github.com/nodejs/summit)
repository for details.
* If you are interested in helping to fix coverity reports consider requesting
access to the projects coverity project as outlined in [static-analysis][].
* If you are interested in helping to fix coverity reports, consider requesting
access to the project's coverity project as outlined in [static-analysis][].
* If you are interested in helping out with CI reliability, check out the
[reliability repository][] and [guide on how to deal with CI flakes][]. When
fixing a flaky test, it is recommended to run [`node-stress-single-test`][]
Expand Down
1 change: 1 addition & 0 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
kAllowedInEnvvar,
false,
OptionNamespaces::kPermissionNamespace);
AddOption("--experimental-repl-await", "", NoOp{}, kAllowedInEnvvar);
AddOption("--experimental-vm-modules",
"experimental ES Module support in vm module",
BOOL_FIELD(experimental_vm_modules),
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-async-local-storage-bind.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const common = require('../common');
const assert = require('assert');
const { AsyncLocalStorage } = require('async_hooks');

[1, false, '', {}, []].forEach((i) => {
for (const i of [1, false, '', {}, []]) {
assert.throws(() => AsyncLocalStorage.bind(i), {
code: 'ERR_INVALID_ARG_TYPE'
});
});
}

const fn = common.mustCall(AsyncLocalStorage.bind(() => 123));
assert.strictEqual(fn(), 123);
Expand Down
11 changes: 7 additions & 4 deletions test/parallel/test-btoa-atob.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ assert.strictEqual(atob({ toString: () => '' }), '');
assert.strictEqual(atob({ [Symbol.toPrimitive]: () => '' }), '');

assert.throws(() => atob(Symbol()), /TypeError/);
[
const testCases = [
undefined, false, () => {}, {}, [1],
0, 1, 0n, 1n, -Infinity,
'a', 'a\n\n\n', '\ra\r\r', ' a ', '\t\t\ta', 'a\f\f\f', '\ta\r \n\f',
].forEach((value) =>
// See #2 - https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob
];

// See #2 - https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob
for (const value of testCases) {
assert.throws(() => atob(value), {
constructor: DOMException,
name: 'InvalidCharacterError',
code: 5,
}));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ function test(stringVariant) {
child.on('exit', common.mustCall((code) => assert.strictEqual(code, 0)));
}

['pipe', 'inherit', 'ignore'].forEach(test);
const testCases = ['pipe', 'inherit', 'ignore'];
for (const value of testCases) {
test(value);
}
4 changes: 2 additions & 2 deletions test/parallel/test-child-process-ipc-next-tick.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ if (process.argv[2] === 'child') {

child.on('message', common.mustCall((msg) => {
assert.strictEqual(msg, 'ready');
values.forEach((value) => {
for (const value of values) {
child.send(value);
});
};
}));
}
4 changes: 3 additions & 1 deletion test/parallel/test-debugger-pid.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ interfacer.stderr.setEncoding('utf-8');
const onData = (data) => {
data = (buffer + data).split('\n');
buffer = data.pop();
data.forEach((line) => interfacer.emit('line', line));
for (const line of data) {
interfacer.emit('line', line);
}
};
interfacer.stdout.on('data', onData);
interfacer.stderr.on('data', onData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ require('../common');

const assert = require('assert');
const { internalBinding } = require('internal/test/binding');
[
const testCases = [
internalBinding('udp_wrap').UDP.prototype.bind6,
internalBinding('tcp_wrap').TCP.prototype.bind6,
internalBinding('udp_wrap').UDP.prototype.send6,
internalBinding('tcp_wrap').TCP.prototype.bind,
internalBinding('udp_wrap').UDP.prototype.close,
internalBinding('tcp_wrap').TCP.prototype.open,
].forEach((binding, i) => {
];
for (const [i, binding] of testCases.entries()) {
assert.strictEqual('prototype' in binding, false, `Test ${i} failed`);
});
}
4 changes: 2 additions & 2 deletions test/parallel/test-events-uncaught-exception-stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const EventEmitter = require('events');
process.on('uncaughtException', common.mustCall((err) => {
const [firstLine, ...lines] = err.stack.split('\n');
assert.strictEqual(firstLine, 'Error');
lines.forEach((line) => {
for (const line of lines) {
assert.match(line, /^ {4}at/);
});
}
}));

new EventEmitter().emit('error', new Error());
7 changes: 4 additions & 3 deletions test/parallel/test-fs-buffertype-writesync.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ require('../common');
const assert = require('assert');
const fs = require('fs');

[
const testCases = [
true, false, 0, 1, Infinity, () => {}, {}, [], undefined, null,
].forEach((value) => {
];
for (const value of testCases) {
assert.throws(
() => fs.writeSync(1, value),
{ message: /"buffer"/, code: 'ERR_INVALID_ARG_TYPE' }
);
});
}
14 changes: 7 additions & 7 deletions test/parallel/test-fs-cp-sync-verbatim-symlinks-invalid.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import fixtures from '../common/fixtures.js';
tmpdir.refresh();

const src = fixtures.path('copy/kitchen-sink');
[1, [], {}, null, 1n, undefined, null, Symbol(), '', () => {}]
.forEach((verbatimSymlinks) => {
assert.throws(
() => cpSync(src, src, { verbatimSymlinks }),
{ code: 'ERR_INVALID_ARG_TYPE' }
);
});
const testCases = [1, [], {}, null, 1n, undefined, null, Symbol(), '', () => {}];
for (const verbatimSymlinks of testCases) {
assert.throws(
() => cpSync(src, src, { verbatimSymlinks }),
{ code: 'ERR_INVALID_ARG_TYPE' }
);
}
5 changes: 3 additions & 2 deletions test/parallel/test-fs-readlink-type-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const common = require('../common');
const assert = require('assert');
const fs = require('fs');

[false, 1, {}, [], null, undefined].forEach((i) => {
const testCases = [false, 1, {}, [], null, undefined];
for (const i of testCases) {
assert.throws(
() => fs.readlink(i, common.mustNotCall()),
{
Expand All @@ -19,4 +20,4 @@ const fs = require('fs');
name: 'TypeError'
}
);
});
}
5 changes: 3 additions & 2 deletions test/parallel/test-fs-rmdir-type-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const common = require('../common');
const assert = require('assert');
const fs = require('fs');

[false, 1, [], {}, null, undefined].forEach((i) => {
const testCases = [false, 1, [], {}, null, undefined];
for (const i of testCases) {
assert.throws(
() => fs.rmdir(i, common.mustNotCall()),
{
Expand All @@ -19,4 +20,4 @@ const fs = require('fs');
name: 'TypeError'
}
);
});
}
5 changes: 3 additions & 2 deletions test/parallel/test-fs-unlink-type-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const common = require('../common');
const assert = require('assert');
const fs = require('fs');

[false, 1, {}, [], null, undefined].forEach((i) => {
const testCases = [false, 1, {}, [], null, undefined];
for (const i of testCases) {
assert.throws(
() => fs.unlink(i, common.mustNotCall()),
{
Expand All @@ -19,4 +20,4 @@ const fs = require('fs');
name: 'TypeError'
}
);
});
}
4 changes: 2 additions & 2 deletions test/parallel/test-http-correct-hostname.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (common.hasCrypto) {
modules.https = https;
}

Object.keys(modules).forEach((module) => {
for (const module of Object.keys(modules)) {
const doNotCall = common.mustNotCall(
`${module}.request should not connect to ${module}://example.com%60x.example.com`
);
Expand All @@ -25,4 +25,4 @@ Object.keys(modules).forEach((module) => {
'example.com`x.example.com',
]);
req.abort();
});
};
5 changes: 3 additions & 2 deletions test/parallel/test-http-hostname-typechecking.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const http = require('http');
// when passed as the value of either options.hostname or options.host
const vals = [{}, [], NaN, Infinity, -Infinity, true, false, 1, 0, new Date()];

vals.forEach((v) => {

for (const v of vals) {
const received = common.invalidArgTypeHelper(v);
assert.throws(
() => http.request({ hostname: v }),
Expand All @@ -31,7 +32,7 @@ vals.forEach((v) => {
received
}
);
});
}

// These values are OK and should not throw synchronously.
// Only testing for 'hostname' validation so ignore connection errors.
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-http-req-close-robust-from-tampering.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const { connect } = require('net');
// cause an error.

const server = createServer(common.mustCall((req, res) => {
req.client._events.close.forEach((fn) => { fn.bind(req)(); });
const closeHandlers = req.client._events.close;
for (const fn of closeHandlers) { fn.bind(req)(); }
}));

server.unref();
Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-http-server-unconsume.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const assert = require('assert');
const http = require('http');
const net = require('net');

['on', 'addListener', 'prependListener'].forEach((testFn) => {
const testCases = ['on', 'addListener', 'prependListener'];
for (const testFn of testCases) {
let received = '';

const server = http.createServer(function(req, res) {
Expand All @@ -30,4 +31,4 @@ const net = require('net');
}));
}));
}));
});
};
5 changes: 3 additions & 2 deletions test/parallel/test-http2-server-settimeout-no-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ const http2 = require('http2');
const verifyCallbacks = common.mustCall((server) => {
const testTimeout = 10;

[true, 1, {}, [], null, 'test'].forEach((notFunction) => {
const testCases = [true, 1, {}, [], null, 'test'];
for (const notFunction of testCases) {
assert.throws(
() => server.setTimeout(testTimeout, notFunction),
{
name: 'TypeError',
code: 'ERR_INVALID_ARG_TYPE',
}
);
});
};

// No callback
const returnedVal = server.setTimeout(testTimeout);
Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-http2-status-code-invalid.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ function expectsError(code) {
server.on('stream', common.mustCall((stream) => {

// Anything lower than 100 and greater than 599 is rejected
[ 99, 700, 1000 ].forEach((i) => {
const testCases = [ 99, 700, 1000 ];
for (const i of testCases) {
assert.throws(() => stream.respond({ ':status': i }), expectsError(i));
});
}

stream.respond();
stream.end();
Expand Down
Loading
Loading