diff options
author | cjihrig <cjihrig@gmail.com> | 2019-05-29 16:22:52 +0300 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-05-31 18:13:25 +0300 |
commit | d05668d6884992765e94cec2ba755feb946071c1 (patch) | |
tree | c7bf23463e47846f4571ef9a0ec644033b4c3002 /lib/internal/child_process.js | |
parent | 80d9b1c712c16753e7ce673564b5653f0633722c (diff) |
child_process: runtime deprecate _channel
This commit moves DEP0129 to a runtime deprecation.
PR-URL: https://github.com/nodejs/node/pull/27949
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/internal/child_process.js')
-rw-r--r-- | lib/internal/child_process.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 71eeed2994f..67687e1a07a 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -37,7 +37,7 @@ const { TTY } = internalBinding('tty_wrap'); const { UDP } = internalBinding('udp_wrap'); const SocketList = require('internal/socket_list'); const { owner_symbol } = require('internal/async_hooks').symbols; -const { convertToValidSignal } = require('internal/util'); +const { convertToValidSignal, deprecate } = require('internal/util'); const { isArrayBufferView } = require('internal/util/types'); const spawn_sync = internalBinding('spawn_sync'); const { kStateSymbol } = require('internal/dgram'); @@ -513,14 +513,21 @@ class Control extends EventEmitter { } } +const channelDeprecationMsg = '_channel is deprecated. ' + + 'Use ChildProcess.channel instead.'; + function setupChannel(target, channel) { target.channel = channel; - // _channel can be deprecated in version 8 Object.defineProperty(target, '_channel', { - get() { return target.channel; }, - set(val) { target.channel = val; }, - enumerable: true + get: deprecate(() => { + return target.channel; + }, channelDeprecationMsg, 'DEP0129'), + set: deprecate((val) => { + target.channel = val; + }, channelDeprecationMsg, 'DEP0129'), + configurable: true, + enumerable: false }); target._handleQueue = null; |