Skip to content

Commit f94381c

Browse files
committed
Fix browser support for util.inspect.custom fix
1 parent fd1efbf commit f94381c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

build/files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ const util = require('util')
333333
/$/,
334334
`
335335
336-
if (util && util.inspect.custom) {
336+
if (util && util.inspect && util.inspect.custom) {
337337
module.exports.prototype[util.inspect.custom] = function () {
338338
const obj = util.inspect({ length: this.length });
339339
return \`\${this.constructor.name} \${obj}\`;

lib/internal/streams/BufferList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module.exports = function () {
7171
return BufferList;
7272
}();
7373

74-
if (util && util.inspect.custom) {
74+
if (util && util.inspect && util.inspect.custom) {
7575
module.exports.prototype[util.inspect.custom] = function () {
7676
var obj = util.inspect({ length: this.length });
7777
return this.constructor.name + ' ' + obj;

0 commit comments

Comments
 (0)