From c7e628f8b3b6f2b7dcb2f3d70708454ee66cbf26 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 21 Feb 2019 10:42:04 -0800 Subject: [PATCH] lib: deprecate _stream_wrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Its unused by node, and doesn't have a reasonable use outside of node. See: https://github.com/nodejs/node/pull/25153 See: https://github.com/nodejs/node/pull/16158 PR-URL: https://github.com/nodejs/node/pull/26245 Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Matteo Collina Reviewed-By: Tobias Nießen --- doc/api/deprecations.md | 13 +++++++++++++ lib/_stream_wrap.js | 2 ++ test/parallel/test-warn-stream-wrap.js | 10 ++++++++++ 3 files changed, 25 insertions(+) create mode 100644 test/parallel/test-warn-stream-wrap.js diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 60151401fb2..dbd9e8648c6 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2349,6 +2349,19 @@ Type: Runtime This property is a reference to the instance itself. + +### DEP0XXX: require('\_stream\_wrap') + + +Type: Runtime + +The `_stream_wrap` module is deprecated. + [`--pending-deprecation`]: cli.html#cli_pending_deprecation [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size [`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array diff --git a/lib/_stream_wrap.js b/lib/_stream_wrap.js index 5b5f476948b..227548e59db 100644 --- a/lib/_stream_wrap.js +++ b/lib/_stream_wrap.js @@ -1,3 +1,5 @@ 'use strict'; module.exports = require('internal/js_stream_socket'); +process.emitWarning('The _stream_wrap module is deprecated.', + 'DeprecationWarning', 'DEP0XXX'); diff --git a/test/parallel/test-warn-stream-wrap.js b/test/parallel/test-warn-stream-wrap.js new file mode 100644 index 00000000000..ffc2c510d0a --- /dev/null +++ b/test/parallel/test-warn-stream-wrap.js @@ -0,0 +1,10 @@ +'use strict'; + +const common = require('../common'); + +// _stream_wrap is deprecated. + +common.expectWarning('DeprecationWarning', + 'The _stream_wrap module is deprecated.', 'DEP0XXX'); + +require('_stream_wrap');