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

async_hooks: remove deprecated APIs #14414

Closed
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/api/deprecations.md
Expand Up @@ -607,7 +607,7 @@ The DebugContext will be removed in V8 soon and will not be available in Node
<a id="DEP0070"></a>
### DEP0070: async_hooks.currentId()

Type: Runtime
Type: End-of-Life

`async_hooks.currentId()` was renamed to `async_hooks.executionAsyncId()` for
clarity.
Expand All @@ -617,7 +617,7 @@ clarity.
<a id="DEP0071"></a>
### DEP0071: async_hooks.triggerId()

Type: Runtime
Type: End-of-Life

`async_hooks.triggerId()` was renamed to `async_hooks.triggerAsyncId()` for
clarity.
Expand All @@ -627,7 +627,7 @@ clarity.
<a id="DEP0072"></a>
### DEP0072: async_hooks.AsyncResource.triggerId()

Type: Runtime
Type: End-of-Life

`async_hooks.AsyncResource.triggerId()` was renamed to
`async_hooks.AsyncResource.triggerAsyncId()` for clarity.
Expand Down
32 changes: 0 additions & 32 deletions lib/async_hooks.js
@@ -1,6 +1,5 @@
'use strict';

const internalUtil = require('internal/util');
const async_wrap = process.binding('async_wrap');
/* Both these arrays are used to communicate between JS and C++ with as little
* overhead as possible.
Expand Down Expand Up @@ -244,17 +243,6 @@ class AsyncResource {
}


// triggerId was renamed to triggerAsyncId. This was in 8.2.0 during the
// experimental stage so the alias can be removed at any time, we are just
// being nice :)
Object.defineProperty(AsyncResource.prototype, 'triggerId', {
get: internalUtil.deprecate(function() {
return AsyncResource.prototype.triggerAsyncId;
}, 'AsyncResource.triggerId is deprecated. ' +
'Use AsyncResource.triggerAsyncId instead.', 'DEP0072')
});


function runInAsyncIdScope(asyncId, cb) {
// Store the async id now to make sure the stack is still good when the ids
// are popped off the stack.
Expand Down Expand Up @@ -461,23 +449,3 @@ module.exports = {
emitAfter: emitAfterScript,
emitDestroy: emitDestroyScript,
};

// currentId was renamed to executionAsyncId. This was in 8.2.0 during the
// experimental stage so the alias can be removed at any time, we are just
// being nice :)
Object.defineProperty(module.exports, 'currentId', {
get: internalUtil.deprecate(function() {
return executionAsyncId;
}, 'async_hooks.currentId is deprecated. ' +
'Use async_hooks.executionAsyncId instead.', 'DEP0070')
});

// triggerId was renamed to triggerAsyncId. This was in 8.2.0 during the
// experimental stage so the alias can be removed at any time, we are just
// being nice :)
Object.defineProperty(module.exports, 'triggerId', {
get: internalUtil.deprecate(function() {
return triggerAsyncId;
}, 'async_hooks.triggerId is deprecated. ' +
'Use async_hooks.triggerAsyncId instead.', 'DEP0071')
});
8 changes: 0 additions & 8 deletions src/async-wrap.cc
Expand Up @@ -745,19 +745,11 @@ async_id AsyncHooksGetExecutionAsyncId(Isolate* isolate) {
return Environment::GetCurrent(isolate)->current_async_id();
}

async_id AsyncHooksGetCurrentId(Isolate* isolate) {
return AsyncHooksGetExecutionAsyncId(isolate);
}


async_id AsyncHooksGetTriggerAsyncId(Isolate* isolate) {
return Environment::GetCurrent(isolate)->trigger_id();
}

async_id AsyncHooksGetTriggerId(Isolate* isolate) {
return AsyncHooksGetTriggerAsyncId(isolate);
}


async_context EmitAsyncInit(Isolate* isolate,
Local<Object> resource,
Expand Down
14 changes: 0 additions & 14 deletions src/node.h
Expand Up @@ -533,17 +533,9 @@ NODE_EXTERN void AddPromiseHook(v8::Isolate* isolate,
* zero then no execution has been set. This will happen if the user handles
* I/O from native code. */
NODE_EXTERN async_id AsyncHooksGetExecutionAsyncId(v8::Isolate* isolate);
/* legacy alias */
NODE_EXTERN NODE_DEPRECATED("Use AsyncHooksGetExecutionAsyncId(isolate)",
async_id AsyncHooksGetCurrentId(v8::Isolate* isolate));


/* Return same value as async_hooks.triggerAsyncId(); */
NODE_EXTERN async_id AsyncHooksGetTriggerAsyncId(v8::Isolate* isolate);
/* legacy alias */
NODE_EXTERN NODE_DEPRECATED("Use AsyncHooksGetTriggerAsyncId(isolate)",
async_id AsyncHooksGetTriggerId(v8::Isolate* isolate));


/* If the native API doesn't inherit from the helper class then the callbacks
* must be triggered manually. This triggers the init() callback. The return
Expand Down Expand Up @@ -643,12 +635,6 @@ class AsyncResource {
return resource_.Get(isolate_);
}

NODE_DEPRECATED("Use AsyncResource::get_async_id()",
async_id get_uid() const {
return get_async_id();
}
)

async_id get_async_id() const {
return async_context_.async_id;
}
Expand Down