Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: runtime deprecate flag --trace-atomics-wait #51179

Closed
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
9 changes: 7 additions & 2 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3313,16 +3313,21 @@ Values other than `undefined`, `null`, integer numbers, and integer strings

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/51179
description: Runtime deprecation.
- version:
- v18.8.0
- v16.18.0
pr-url: https://github.com/nodejs/node/pull/44093
description: Documentation-only deprecation.
-->

Type: Documentation-only
Type: Runtime

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

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

Expand Down
4 changes: 4 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ void Environment::InitializeDiagnostics() {
if (options_->trace_uncaught)
isolate_->SetCaptureStackTraceForUncaughtExceptions(true);
if (options_->trace_atomics_wait) {
ProcessEmitDeprecationWarning(
Environment::GetCurrent(isolate_),
"The flag --trace-atomics-wait is deprecated.",
"DEP0165");
isolate_->SetAtomicsWaitCallback(AtomicsWaitCallback, this);
AddCleanupHook([](void* data) {
Environment* env = static_cast<Environment*>(data);
Expand Down
14 changes: 14 additions & 0 deletions test/parallel/test-trace-atomic-deprecation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

const common = require('../common');
const assert = require('node:assert');
const { test } = require('node:test');

test('should emit deprecation warning DEP0165', async () => {
const { code, stdout, stderr } = await common.spawnPromisified(
process.execPath, ['--trace-atomics-wait', '-e', '{}']
);
assert.match(stderr, /\[DEP0165\] DeprecationWarning:/);
assert.strictEqual(stdout, '');
assert.strictEqual(code, 0);
});
2 changes: 1 addition & 1 deletion test/parallel/test-trace-atomics-wait.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (process.argv[2] === 'child') {

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

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