Commit 915cf105fa8 for nodejs
commit 915cf105fa802c5015e2eed84f7f733e3c1cb791
Author: LiviaMedeiros <livia@cirno.name>
Date: Tue Nov 17 06:33:45 2026 +0800
diagnostics_channel: use `DisposableStack` primordial
Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67533
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
diff --git a/lib/diagnostics_channel.js b/lib/diagnostics_channel.js
index dd600d804fd..61d310d383a 100644
--- a/lib/diagnostics_channel.js
+++ b/lib/diagnostics_channel.js
@@ -7,6 +7,9 @@ const {
ArrayPrototypePushApply,
ArrayPrototypeSlice,
ArrayPrototypeSplice,
+ DisposableStack,
+ DisposableStackPrototypeMove,
+ DisposableStackPrototypeUse,
ObjectDefineProperty,
ObjectGetPrototypeOf,
ObjectSetPrototypeOf,
@@ -97,7 +100,6 @@ class RunStoresScope {
#stack;
constructor(activeChannel, data) {
- // eslint-disable-next-line no-restricted-globals
using stack = new DisposableStack();
// Enter stores using withScope
@@ -118,7 +120,7 @@ class RunStoresScope {
}
}
- stack.use(store.withScope(newContext));
+ DisposableStackPrototypeUse(stack, store.withScope(newContext));
}
}
@@ -126,7 +128,7 @@ class RunStoresScope {
activeChannel.publish(data);
// Transfer ownership of the stack
- this.#stack = stack.move();
+ this.#stack = DisposableStackPrototypeMove(stack);
}
[SymbolDispose]() {
diff --git a/lib/eslint.config_partial.mjs b/lib/eslint.config_partial.mjs
index 1bb6bad8d7d..f1985d93ea9 100644
--- a/lib/eslint.config_partial.mjs
+++ b/lib/eslint.config_partial.mjs
@@ -437,6 +437,7 @@ export default [
{ name: 'AggregateError' },
{ name: 'Array' },
{ name: 'ArrayBuffer' },
+ { name: 'AsyncDisposableStack' },
{ name: 'Atomics' },
{ name: 'BigInt' },
{ name: 'BigInt64Array' },
@@ -444,6 +445,7 @@ export default [
{ name: 'Boolean' },
{ name: 'DataView' },
{ name: 'Date' },
+ { name: 'DisposableStack' },
{ name: 'decodeURI' },
{ name: 'decodeURIComponent' },
{ name: 'encodeURI' },