lib: remove usage of require('util')
Remove usage of public require('util') in `internal/child_process`. Refs: https://github.com/nodejs/node/issues/26546 PR-URL: https://github.com/nodejs/node/pull/26773 Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
parent
c8d3a73c8b
commit
1500e5de64
@ -18,7 +18,7 @@ const { validateString } = require('internal/validators');
|
|||||||
const EventEmitter = require('events');
|
const EventEmitter = require('events');
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
const util = require('util');
|
const inspect = require('internal/util/inspect').inspect;
|
||||||
const assert = require('internal/assert');
|
const assert = require('internal/assert');
|
||||||
|
|
||||||
const { Process } = internalBinding('process_wrap');
|
const { Process } = internalBinding('process_wrap');
|
||||||
@ -887,7 +887,7 @@ function _validateStdio(stdio, sync) {
|
|||||||
throw new ERR_INVALID_OPT_VALUE('stdio', stdio);
|
throw new ERR_INVALID_OPT_VALUE('stdio', stdio);
|
||||||
}
|
}
|
||||||
} else if (!Array.isArray(stdio)) {
|
} else if (!Array.isArray(stdio)) {
|
||||||
throw new ERR_INVALID_OPT_VALUE('stdio', util.inspect(stdio));
|
throw new ERR_INVALID_OPT_VALUE('stdio', inspect(stdio));
|
||||||
}
|
}
|
||||||
|
|
||||||
// At least 3 stdio will be created
|
// At least 3 stdio will be created
|
||||||
@ -967,12 +967,12 @@ function _validateStdio(stdio, sync) {
|
|||||||
} else if (isArrayBufferView(stdio) || typeof stdio === 'string') {
|
} else if (isArrayBufferView(stdio) || typeof stdio === 'string') {
|
||||||
if (!sync) {
|
if (!sync) {
|
||||||
cleanup();
|
cleanup();
|
||||||
throw new ERR_INVALID_SYNC_FORK_INPUT(util.inspect(stdio));
|
throw new ERR_INVALID_SYNC_FORK_INPUT(inspect(stdio));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Cleanup
|
// Cleanup
|
||||||
cleanup();
|
cleanup();
|
||||||
throw new ERR_INVALID_OPT_VALUE('stdio', util.inspect(stdio));
|
throw new ERR_INVALID_OPT_VALUE('stdio', inspect(stdio));
|
||||||
}
|
}
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user