From a4c28d77f7306ce20134a53859532e159a11beb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 20 Mar 2018 16:41:31 +0100 Subject: [PATCH] doc: fix deprecation removed by mistake In https://github.com/nodejs/node/commit/bae5de1949b8fed3b6f0653e7c1e9d860666e5af, a deprecation (DEP0089) was added to the docs and another one (DEP0098) was removed by mistake. This commit restores it. PR-URL: https://github.com/nodejs/node/pull/19482 Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig --- doc/api/deprecations.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index ef4aac36047fed..8fda9128090f2a 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -783,6 +783,18 @@ Importing assert directly is not recommended as the exposed functions will use loose equality checks. Use `require('assert').strict` instead. The API is the same as the legacy assert but it will always use strict equality checks. + +### DEP0098: AsyncHooks Embedder AsyncResource.emit{Before,After} APIs + +Type: Runtime + +The embedded API provided by AsyncHooks exposes emit{Before,After} methods +which are very easy to use incorrectly which can lead to unrecoverable errors. + +Use [`asyncResource.runInAsyncScope()`][] API instead which provides a much +safer, and more convenient, alternative. See +https://github.com/nodejs/node/pull/18513 for more details. + [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size [`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array [`Buffer.from(buffer)`]: buffer.html#buffer_class_method_buffer_from_buffer @@ -792,6 +804,7 @@ same as the legacy assert but it will always use strict equality checks. [`Server.getConnections()`]: net.html#net_server_getconnections_callback [`Server.listen({fd: })`]: net.html#net_server_listen_handle_backlog_callback [`SlowBuffer`]: buffer.html#buffer_class_slowbuffer +[`asyncResource.runInAsyncScope()`]: async_hooks.html#async_hooks_asyncresource_runinasyncscope_fn_thisarg_args [`child_process`]: child_process.html [`console.error()`]: console.html#console_console_error_data_args [`console.log()`]: console.html#console_console_log_data_args