Skip to content

Commit

Permalink
Fix browser support for util.inspect.custom fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Feb 9, 2018
1 parent fd1efbf commit f94381c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/files.js
Expand Up @@ -333,7 +333,7 @@ const util = require('util')
/$/,
`
if (util && util.inspect.custom) {
if (util && util.inspect && util.inspect.custom) {
module.exports.prototype[util.inspect.custom] = function () {
const obj = util.inspect({ length: this.length });
return \`\${this.constructor.name} \${obj}\`;
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/streams/BufferList.js
Expand Up @@ -71,7 +71,7 @@ module.exports = function () {
return BufferList;
}();

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

0 comments on commit f94381c

Please sign in to comment.