Skip to content

Commit

Permalink
lib: remove usage of require('util')
Browse files Browse the repository at this point in the history
Remove usage of public require('util') in
`internal/child_process`.

Refs: #26546

PR-URL: #26773
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
dnlup authored and ZYSzys committed Mar 21, 2019
1 parent c8d3a73 commit 1500e5d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/internal/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { validateString } = require('internal/validators');
const EventEmitter = require('events');
const net = require('net');
const dgram = require('dgram');
const util = require('util');
const inspect = require('internal/util/inspect').inspect;
const assert = require('internal/assert');

const { Process } = internalBinding('process_wrap');
Expand Down Expand Up @@ -887,7 +887,7 @@ function _validateStdio(stdio, sync) {
throw new ERR_INVALID_OPT_VALUE('stdio', 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
Expand Down Expand Up @@ -967,12 +967,12 @@ function _validateStdio(stdio, sync) {
} else if (isArrayBufferView(stdio) || typeof stdio === 'string') {
if (!sync) {
cleanup();
throw new ERR_INVALID_SYNC_FORK_INPUT(util.inspect(stdio));
throw new ERR_INVALID_SYNC_FORK_INPUT(inspect(stdio));
}
} else {
// Cleanup
cleanup();
throw new ERR_INVALID_OPT_VALUE('stdio', util.inspect(stdio));
throw new ERR_INVALID_OPT_VALUE('stdio', inspect(stdio));
}

return acc;
Expand Down

0 comments on commit 1500e5d

Please sign in to comment.