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

domain: EoL deprecate MakeCallback with domain property #55034

Closed
wants to merge 1 commit into from
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
5 changes: 4 additions & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2087,12 +2087,15 @@ Type: Runtime

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/55034
description: End-of-Life.
- version: v10.0.0
pr-url: https://github.com/nodejs/node/pull/17417
description: Runtime deprecation.
-->

Type: Runtime
Type: End-of-Life

Users of `MakeCallback` that add the `domain` property to carry context,
should start using the `async_context` variant of `MakeCallback` or
Expand Down
17 changes: 0 additions & 17 deletions lib/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,25 +136,8 @@ process.setUncaughtExceptionCaptureCallback = function(fn) {
throw err;
};


let sendMakeCallbackDeprecation = false;
function emitMakeCallbackDeprecation({ target, method }) {
if (!sendMakeCallbackDeprecation) {
process.emitWarning(
'Using a domain property in MakeCallback is deprecated. Use the ' +
'async_context variant of MakeCallback or the AsyncResource class ' +
'instead. ' +
`(Triggered by calling ${method?.name || '<anonymous>'} ` +
`on ${target?.constructor?.name}.)`,
'DeprecationWarning', 'DEP0097');
sendMakeCallbackDeprecation = true;
}
}

function topLevelDomainCallback(cb, ...args) {
const domain = this.domain;
if (exports.active && domain)
emitMakeCallbackDeprecation({ target: this, method: cb });

if (domain)
domain.enter();
Expand Down
32 changes: 0 additions & 32 deletions test/addons/make-callback-domain-warning/binding.cc

This file was deleted.

9 changes: 0 additions & 9 deletions test/addons/make-callback-domain-warning/binding.gyp

This file was deleted.

43 changes: 0 additions & 43 deletions test/addons/make-callback-domain-warning/test.js

This file was deleted.

Loading