Skip to content

Commit b9df88a

Browse files
marco-ippolitojasnell
authored andcommitted
doc: runtime deprecate flag --trace-atomics-wait
PR-URL: #51179 Refs: #42982 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 1523650 commit b9df88a

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
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: https://github.com/nodejs/node/pull/51179
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('node:assert');
5+
const { test } = require('node:test');
6+
7+
test('should emit deprecation warning DEP0165', async () => {
8+
const { code, stdout, stderr } = await common.spawnPromisified(
9+
process.execPath, ['--trace-atomics-wait', '-e', '{}']
10+
);
11+
assert.match(stderr, /\[DEP0165\] DeprecationWarning:/);
12+
assert.strictEqual(stdout, '');
13+
assert.strictEqual(code, 0);
14+
});

test/parallel/test-trace-atomics-wait.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if (process.argv[2] === 'child') {
2525

2626
const proc = child_process.spawnSync(
2727
process.execPath,
28-
[ '--trace-atomics-wait', __filename, 'child' ],
28+
[ '--disable-warning=DEP0165', '--trace-atomics-wait', __filename, 'child' ],
2929
{ encoding: 'utf8', stdio: [ 'inherit', 'inherit', 'pipe' ] });
3030

3131
if (proc.status !== 0) console.log(proc);

0 commit comments

Comments
 (0)