Skip to content

Commit

Permalink
async_hooks: remove runtime deprecation
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ofrobots authored and rvagg committed Aug 16, 2018
1 parent 7e23946 commit 373f4d6
Showing 1 changed file with 0 additions and 13 deletions.
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

0 comments on commit 373f4d6

Please sign in to comment.