Skip to content

Commit df16f0f

Browse files
authored
child_process: move _channel to end-of-life
The `._channel` property has been deprecated for many years now. It's time to remove it. PR-URL: #58527 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 2be863b commit df16f0f

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

doc/api/deprecations.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2705,6 +2705,9 @@ Node.js versions.
27052705

27062706
<!-- YAML
27072707
changes:
2708+
- version: REPLACEME
2709+
pr-url: https://github.com/nodejs/node/pull/58527
2710+
description: End-of-Life.
27082711
- version: v13.0.0
27092712
pr-url: https://github.com/nodejs/node/pull/27949
27102713
description: Runtime deprecation.
@@ -2713,7 +2716,7 @@ changes:
27132716
description: Documentation-only.
27142717
-->
27152718

2716-
Type: Runtime
2719+
Type: End-of-Life
27172720

27182721
The `_channel` property of child process objects returned by `spawn()` and
27192722
similar functions is not intended for public use. Use `ChildProcess.channel`

lib/internal/child_process.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const {
77
ArrayPrototypeSlice,
88
FunctionPrototype,
99
FunctionPrototypeCall,
10-
ObjectDefineProperty,
1110
ObjectSetPrototypeOf,
1211
ReflectApply,
1312
StringPrototypeSlice,
@@ -56,7 +55,7 @@ const { TTY } = internalBinding('tty_wrap');
5655
const { UDP } = internalBinding('udp_wrap');
5756
const SocketList = require('internal/socket_list');
5857
const { owner_symbol } = require('internal/async_hooks').symbols;
59-
const { convertToValidSignal, deprecate } = require('internal/util');
58+
const { convertToValidSignal } = require('internal/util');
6059
const { isArrayBufferView } = require('internal/util/types');
6160
const spawn_sync = internalBinding('spawn_sync');
6261
const { kStateSymbol } = require('internal/dgram');
@@ -575,27 +574,12 @@ class Control extends EventEmitter {
575574
}
576575
}
577576

578-
const channelDeprecationMsg = '_channel is deprecated. ' +
579-
'Use ChildProcess.channel instead.';
580-
581577
let serialization;
582578
function setupChannel(target, channel, serializationMode) {
583579
const control = new Control(channel);
584580
target.channel = control;
585581
target[kChannelHandle] = channel;
586582

587-
ObjectDefineProperty(target, '_channel', {
588-
__proto__: null,
589-
get: deprecate(() => {
590-
return target.channel;
591-
}, channelDeprecationMsg, 'DEP0129'),
592-
set: deprecate((val) => {
593-
target.channel = val;
594-
}, channelDeprecationMsg, 'DEP0129'),
595-
configurable: true,
596-
enumerable: false,
597-
});
598-
599583
target._handleQueue = null;
600584
target._pendingMessage = null;
601585

test/parallel/test-child-process-fork.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1919
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
21-
// Flags: --no-warnings
2221
'use strict';
2322
const common = require('../common');
2423
const assert = require('assert');
@@ -29,7 +28,6 @@ const debug = require('util').debuglog('test');
2928

3029
const n = fork(fixtures.path('child-process-spawn-node.js'), args);
3130

32-
assert.strictEqual(n.channel, n._channel);
3331
assert.deepStrictEqual(args, ['foo', 'bar']);
3432

3533
n.on('message', (m) => {

0 commit comments

Comments
 (0)