From a1fb336558f1dc0a536d925a6599761da89dcd8e 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 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 --- 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 e8ea13ffbd6c26..641bcfb5c76a10 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2348,6 +2348,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 5b5f476948b23a..227548e59db59a 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 00000000000000..ffc2c510d0a3ef --- /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');