lib: move DEP0006 to end of life

This commit moves DEP0006, which has been runtime deprecated
since Node 0.11, to end of life status.

PR-URL: https://github.com/nodejs/node/pull/25279
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
This commit is contained in:
cjihrig 2018-12-29 19:53:03 -05:00
parent 7d453ff212
commit d4934ae6f2
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5
3 changed files with 5 additions and 67 deletions

View File

@ -160,6 +160,9 @@ outside `node_modules` in order to better target developers, rather than users.
### DEP0006: child\_process options.customFds
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/25279
description: End-of-Life.
- version:
- v4.8.6
- v6.12.0
@ -171,7 +174,7 @@ changes:
description: Documentation-only deprecation.
-->
Type: Runtime
Type: End-of-Life
Within the [`child_process`][] module's `spawn()`, `fork()`, and `exec()`
methods, the `options.customFds` option is deprecated. The `options.stdio`

View File

@ -22,9 +22,7 @@
'use strict';
const util = require('util');
const {
deprecate, convertToValidSignal, getSystemErrorName
} = require('internal/util');
const { convertToValidSignal, getSystemErrorName } = require('internal/util');
const { isArrayBufferView } = require('internal/util/types');
const debug = util.debuglog('child_process');
const { Buffer } = require('buffer');
@ -384,20 +382,6 @@ Object.defineProperty(exports.execFile, util.promisify.custom, {
value: customPromiseExecFunction(exports.execFile)
});
const _deprecatedCustomFds = deprecate(
function deprecateCustomFds(options) {
options.stdio = options.customFds.map(function mapCustomFds(fd) {
return fd === -1 ? 'pipe' : fd;
});
}, 'child_process: options.customFds option is deprecated. ' +
'Use options.stdio instead.', 'DEP0006');
function _convertCustomFds(options) {
if (options.customFds && !options.stdio) {
_deprecatedCustomFds(options);
}
}
function normalizeSpawnArguments(file, args, options) {
validateString(file, 'file');
@ -526,8 +510,6 @@ function normalizeSpawnArguments(file, args, options) {
}
}
_convertCustomFds(options);
return {
file: file,
args: args,

View File

@ -1,47 +0,0 @@
// Flags: --expose_internals
'use strict';
const common = require('../common');
const assert = require('assert');
const { spawnSync } = require('child_process');
const internalCp = require('internal/child_process');
if (!common.isMainThread)
common.skip('stdio is not associated with file descriptors in Workers');
// This test uses the deprecated `customFds` option. We expect a deprecation
// warning, but only once (per node process).
const msg = 'child_process: options.customFds option is deprecated. ' +
'Use options.stdio instead.';
common.expectWarning('DeprecationWarning', msg, 'DEP0006');
// Verify that customFds is used if stdio is not provided.
{
const customFds = [-1, process.stdout.fd, process.stderr.fd];
const oldSpawnSync = internalCp.spawnSync;
internalCp.spawnSync = common.mustCall(function(opts) {
assert.deepStrictEqual(opts.options.customFds, customFds);
assert.deepStrictEqual(opts.options.stdio, [
{ type: 'pipe', readable: true, writable: false },
{ type: 'fd', fd: process.stdout.fd },
{ type: 'fd', fd: process.stderr.fd }
]);
});
spawnSync(...common.pwdCommand, { customFds });
internalCp.spawnSync = oldSpawnSync;
}
// Verify that customFds is ignored when stdio is present.
{
const customFds = [0, 1, 2];
const oldSpawnSync = internalCp.spawnSync;
internalCp.spawnSync = common.mustCall(function(opts) {
assert.deepStrictEqual(opts.options.customFds, customFds);
assert.deepStrictEqual(opts.options.stdio, [
{ type: 'pipe', readable: true, writable: false },
{ type: 'pipe', readable: false, writable: true },
{ type: 'pipe', readable: false, writable: true }
]);
});
spawnSync(...common.pwdCommand, { customFds, stdio: 'pipe' });
internalCp.spawnSync = oldSpawnSync;
}