Skip to content

Commit f0d10f8

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

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

‎doc/api/deprecations.md‎

Lines changed: 7 additions & 2 deletions
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‎

Lines changed: 4 additions & 0 deletions
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);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
constcommon=require('../common');
4+
constassert=require('assert');
5+
const{ test }=require('node:test');
6+
7+
test('should emit deprecation warning DEP0165',async()=>{
8+
awaitcommon.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+
});

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

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

2626
constproc=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)