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
19 changes: 1 addition & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Select a Node.js version below to view the changelog history:

* [Node.js 26](doc/changelogs/CHANGELOG_V26.md) **Current**
* [Node.js 25](doc/changelogs/CHANGELOG_V25.md) Current
* [Node.js 25](doc/changelogs/CHANGELOG_V25.md) End-of-Life
* [Node.js 24](doc/changelogs/CHANGELOG_V24.md) **Long Term Support**
* [Node.js 23](doc/changelogs/CHANGELOG_V23.md) End-of-Life
* [Node.js 22](doc/changelogs/CHANGELOG_V22.md) Long Term Support
Expand Down Expand Up @@ -36,7 +36,6 @@ release.
<table>
<tr>
<th title="Current"><a href="doc/changelogs/CHANGELOG_V26.md">26</a> (Current)</th>
<th title="Current"><a href="doc/changelogs/CHANGELOG_V25.md">25</a> (Current)</th>
<th title="LTS Until 2028-04"><a href="doc/changelogs/CHANGELOG_V24.md">24</a> (LTS)</th>
<th title="LTS Until 2027-04"><a href="doc/changelogs/CHANGELOG_V22.md">22</a> (LTS)</th>
</tr>
Expand All @@ -48,22 +47,6 @@ release.
<a href="doc/changelogs/CHANGELOG_V26.md#26.0.0">26.0.0</a><br/>
</td>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V25.md#25.9.0">25.9.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.8.2">25.8.2</a><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.8.1">25.8.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.8.0">25.8.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.7.0">25.7.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.6.1">25.6.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.6.0">25.6.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.5.0">25.5.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.4.0">25.4.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.3.0">25.3.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.2.1">25.2.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.2.0">25.2.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.1.0">25.1.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V25.md#25.0.0">25.0.0</a><br/>
</td>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V24.md#24.16.0">24.16.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V24.md#24.15.0">24.15.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V24.md#24.14.1">24.14.1</a><br/>
Expand Down
6 changes: 3 additions & 3 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@ server.on('stream', (stream) => {
Initiates a response. When the `options.waitForTrailers` option is set, the
`'wantTrailers'` event will be emitted immediately after queuing the last chunk
of payload data to be sent. The `http2stream.sendTrailers()` method can then be
used to sent trailing header fields to the peer.
used to send trailing header fields to the peer.

When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
close when the final `DATA` frame is transmitted. User code must call either
Expand Down Expand Up @@ -2065,7 +2065,7 @@ after a stream has finished is supported.

When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
will be emitted immediately after queuing the last chunk of payload data to be
sent. The `http2stream.sendTrailers()` method can then be used to sent trailing
sent. The `http2stream.sendTrailers()` method can then be used to send trailing
header fields to the peer.

When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
Expand Down Expand Up @@ -2270,7 +2270,7 @@ default behavior is to destroy the stream.

When the `options.waitForTrailers` option is set, the `'wantTrailers'` event
will be emitted immediately after queuing the last chunk of payload data to be
sent. The `http2stream.sendTrailers()` method can then be used to sent trailing
sent. The `http2stream.sendTrailers()` method can then be used to send trailing
header fields to the peer.

When `options.waitForTrailers` is set, the `Http2Stream` will not automatically
Expand Down
4 changes: 3 additions & 1 deletion lib/internal/fs/recursive_watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ class FSWatcher extends EventEmitter {
}
}
} catch (error) {
this.emit('error', error);
if (error.code !== 'ENOENT') {
this.emit('error', error);
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/crypto/crypto_aes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ WebCryptoCipherStatus AES_Cipher(Environment* env,
CHECK_EQ(key_data.GetKeyType(), kKeyTypeSecret);

auto ctx = CipherCtxPointer::New();
CHECK(ctx);
if (!ctx) {
return WebCryptoCipherStatus::FAILED;
}

if (params.cipher.isWrapMode()) {
ctx.setAllowWrap();
Expand Down
4 changes: 3 additions & 1 deletion src/crypto/crypto_chacha20_poly1305.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ WebCryptoCipherStatus ChaCha20Poly1305CipherTraits::DoCipher(
return WebCryptoCipherStatus::OK;
#else
auto ctx = CipherCtxPointer::New();
CHECK(ctx);
if (!ctx) {
return WebCryptoCipherStatus::FAILED;
}

const bool encrypt = cipher_mode == kWebCryptoCipherEncrypt;

Expand Down
10 changes: 9 additions & 1 deletion src/crypto/crypto_cipher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ void GetCipherInfo(const FunctionCallbackInfo<Value>& args) {
// If it is, then the getCipherInfo will succeed with the given
// values.
auto ctx = CipherCtxPointer::New();
if (!ctx) {
return THROW_ERR_CRYPTO_OPERATION_FAILED(
env, "Failed to allocate cipher context");
}

if (!ctx.init(cipher, true)) {
return;
}
Expand Down Expand Up @@ -338,7 +343,10 @@ void CipherBase::CommonInit(const char* cipher_type,
MarkPopErrorOnReturn mark_pop_error_on_return;
CHECK(!ctx_);
ctx_ = CipherCtxPointer::New();
CHECK(ctx_);
if (!ctx_) {
return THROW_ERR_CRYPTO_OPERATION_FAILED(
env(), "Failed to allocate cipher context");
}

if (cipher.isWrapMode()) {
ctx_.setAllowWrap();
Expand Down
2 changes: 1 addition & 1 deletion test/async-hooks/test-emit-after-on-destroyed.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if (process.argv[2] === 'child') {
child.on('close', common.mustCall((code, signal) => {
if ((common.isAIX ||
(common.isLinux && process.arch === 'x64')) &&
signal === 'SIGABRT') {
common.nodeProcessAborted(code, signal)) {
// XXX: The child process could be aborted due to unknown reasons. Work around it.
} else {
assert.strictEqual(signal, null);
Expand Down
4 changes: 2 additions & 2 deletions test/async-hooks/test-improper-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ if (process.argv[2] === 'child') {

child.on('close', common.mustCall((code, signal) => {
if ((common.isAIX ||
(common.isLinux && process.arch === 'x64')) &&
signal === 'SIGABRT') {
(common.isLinux && process.arch === 'x64')) &&
common.nodeProcessAborted(code, signal)) {
// XXX: The child process could be aborted due to unknown reasons. Work around it.
} else {
assert.strictEqual(signal, null);
Expand Down
2 changes: 1 addition & 1 deletion test/async-hooks/test-improper-unwind.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if (process.argv[2] === 'child') {
child.on('close', common.mustCall((code, signal) => {
if ((common.isAIX ||
(common.isLinux && process.arch === 'x64')) &&
signal === 'SIGABRT') {
common.nodeProcessAborted(code, signal)) {
// XXX: The child process could be aborted due to unknown reasons. Work around it.
} else {
assert.strictEqual(signal, null);
Expand Down
44 changes: 44 additions & 0 deletions test/parallel/test-fs-watch-recursive-delete-race.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Flags: --expose-internals
'use strict';

const common = require('../common');
const tmpdir = require('../common/tmpdir');
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const { kFSWatchStart } = require('internal/fs/watchers');
const { FSWatcher } = require('internal/fs/recursive_watch');

if (common.isIBMi)
common.skip('IBMi does not support `fs.watch()`');

tmpdir.refresh();

const parent = tmpdir.resolve('parent');
const child = path.join(parent, 'child');
fs.mkdirSync(child, { recursive: true });
fs.writeFileSync(path.join(child, 'test.tmp'), 'test');

const watch = fs.watch;
let deletedChild = false;
fs.watch = function(filename, ...args) {
const watcher = Reflect.apply(watch, this, [filename, ...args]);

if (filename === child) {
fs.rmSync(child, { recursive: true });
deletedChild = true;
}

return watcher;
};

const watcher = new FSWatcher({ recursive: true });
watcher.on('error', common.mustNotCall());

try {
watcher[kFSWatchStart](parent);
assert.strictEqual(deletedChild, true);
} finally {
watcher.close();
fs.watch = watch;
}
Loading