Skip to content

Commit 90c0b28

Browse files
doc: runtime deprecate flag --trace-atomics-wait
1 parent fa18378 commit 90c0b28

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

doc/api/deprecations.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -3313,16 +3313,21 @@ Values other than `undefined`, `null`, integer numbers, and integer strings
33133313

33143314
<!-- YAML
33153315
changes:
3316+
- version: REPLACEME
3317+
pr-url: REPLACEME
3318+
description: Runtime deprecation.
33163319
- version:
33173320
- v18.8.0
33183321
- v16.18.0
33193322
pr-url: https://github.com/nodejs/node/pull/44093
33203323
description: Documentation-only deprecation.
33213324
-->
33223325

3323-
Type: Documentation-only
3326+
Type: Runtime
33243327

3325-
The [`--trace-atomics-wait`][] flag is deprecated.
3328+
The [`--trace-atomics-wait`][] flag is deprecated because
3329+
it uses the V8 hook `SetAtomicsWaitCallback`,
3330+
that will be removed in a future V8 release.
33263331

33273332
### DEP0166: Double slashes in imports and exports targets
33283333

src/node.cc

+4
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ void Environment::InitializeDiagnostics() {
258258
if (options_->trace_uncaught)
259259
isolate_->SetCaptureStackTraceForUncaughtExceptions(true);
260260
if (options_->trace_atomics_wait) {
261+
ProcessEmitDeprecationWarning(
262+
Environment::GetCurrent(isolate_),
263+
"The flag --trace-atomics-wait is deprecated.",
264+
"DEP0165");
261265
isolate_->SetAtomicsWaitCallback(AtomicsWaitCallback, this);
262266
AddCleanupHook([](void* data) {
263267
Environment* env = static_cast<Environment*>(data);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const assert = require('assert');
5+
const { test } = require('node:test');
6+
7+
test('should emit deprecation warning DEP0165', async () => {
8+
await common.spawnPromisified(process.execPath, ['--trace-atomics-wait', '-e', '{}'])
9+
.then(common.mustCall(({ code, stdout, stderr }) => {
10+
assert.strictEqual(code, 0);
11+
assert.strictEqual(stdout, '');
12+
assert.match(stderr, /\[DEP0165\] DeprecationWarning:/);
13+
}));
14+
});

0 commit comments

Comments
 (0)