Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
async_hooks: remove runtime deprecation
As part of the backport to 8.x, this change removes the runtime
deprecation making this a docs-only deprecation for 8.x.

PR-URL: #19517
Reviewed-By: mcollina - Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
ofrobots committed Jun 28, 2018
commit 6696271837cddc488e70ffc0fd073fd7a644240d
13 changes: 0 additions & 13 deletions lib/async_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,6 @@ function triggerAsyncId() {

const destroyedSymbol = Symbol('destroyed');

let emitBeforeAfterWarning = true;
function showEmitBeforeAfterWarning() {
if (emitBeforeAfterWarning) {
process.emitWarning(
'asyncResource.emitBefore and emitAfter are deprecated. Please use ' +
'asyncResource.runInAsyncScope instead',
'DeprecationWarning', 'DEP0098');
emitBeforeAfterWarning = false;
}
}

class AsyncResource {
constructor(type, opts = {}) {
if (typeof type !== 'string')
Expand Down Expand Up @@ -189,13 +178,11 @@ class AsyncResource {
}

emitBefore() {
showEmitBeforeAfterWarning();
emitBefore(this[async_id_symbol], this[trigger_async_id_symbol]);
return this;
}

emitAfter() {
showEmitBeforeAfterWarning();
emitAfter(this[async_id_symbol]);
return this;
}
Expand Down