| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 80d9b1c commit d05668d
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2436,12 +2436,15 @@ Node.js versions. | |||
| 2436 | 2436 | ### DEP0129: ChildProcess._channel | |
| 2437 | 2437 | <!-- YAML | |
| 2438 | 2438 | changes: | |
| 2439 | + - version: REPLACEME | ||
| 2440 | + pr-url: https://github.com/nodejs/node/pull/27949 | ||
| 2441 | + description: Runtime deprecation. | ||
| 2439 | 2442 | - version: v11.14.0 | |
| 2440 | 2443 | pr-url: https://github.com/nodejs/node/pull/26982 | |
| 2441 | 2444 | description: Documentation-only. | |
| 2442 | 2445 | --> | |
| 2443 | 2446 | ||
| 2444 | - Type: Documentation-only | ||
| 2447 | + Type: Runtime | ||
| 2445 | 2448 | ||
| 2446 | 2449 | The `_channel` property of child process objects returned by `spawn()` and | |
| 2447 | 2450 | similar functions is not intended for public use. Use `ChildProcess.channel` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,7 +37,7 @@ const { TTY } = internalBinding('tty_wrap'); | |||
| 37 | 37 | const { UDP } = internalBinding('udp_wrap'); | |
| 38 | 38 | const SocketList = require('internal/socket_list'); | |
| 39 | 39 | const { owner_symbol } = require('internal/async_hooks').symbols; | |
| 40 | - const { convertToValidSignal } = require('internal/util'); | ||
| 40 | + const { convertToValidSignal, deprecate } = require('internal/util'); | ||
| 41 | 41 | const { isArrayBufferView } = require('internal/util/types'); | |
| 42 | 42 | const spawn_sync = internalBinding('spawn_sync'); | |
| 43 | 43 | const { kStateSymbol } = require('internal/dgram'); | |
@@ -513,14 +513,21 @@ class Control extends EventEmitter { | |||
| 513 | 513 | } | |
| 514 | 514 | } | |
| 515 | 515 | ||
| 516 | + const channelDeprecationMsg = '_channel is deprecated. ' + | ||
| 517 | + 'Use ChildProcess.channel instead.'; | ||
| 518 | + | ||
| 516 | 519 | function setupChannel(target, channel) { | |
| 517 | 520 | target.channel = channel; | |
| 518 | 521 | ||
| 519 | - // _channel can be deprecated in version 8 | ||
| 520 | 522 | Object.defineProperty(target, '_channel', { | |
| 521 | - get() { return target.channel; }, | ||
| 522 | - set(val) { target.channel = val; }, | ||
| 523 | - enumerable: true | ||
| 523 | + get: deprecate(() => { | ||
| 524 | + return target.channel; | ||
| 525 | + }, channelDeprecationMsg, 'DEP0129'), | ||
| 526 | + set: deprecate((val) => { | ||
| 527 | + target.channel = val; | ||
| 528 | + }, channelDeprecationMsg, 'DEP0129'), | ||
| 529 | + configurable: true, | ||
| 530 | + enumerable: false | ||
| 524 | 531 | }); | |
| 525 | 532 | ||
| 526 | 533 | target._handleQueue = null; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments