diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-12-12 00:42:34 +0300 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2019-02-28 19:49:10 +0300 |
commit | be78266fb39214b7ab3f1d2353d358561dd8f1f8 (patch) | |
tree | 8f7671f0edf9d0ddfc9894a27610d8a045dee2ec /lib/internal/encoding.js | |
parent | 6c52ef982598fac1cce6ec9cb3831b806295f45c (diff) |
lib: don't use `util.inspect()` internals
This makes sure the internal `stylize` function is not used to render
anything and instead just uses the regular inspect function in case
of reaching the maximum depth level.
PR-URL: https://github.com/nodejs/node/pull/24971
Refs: https://github.com/nodejs/node/issues/24765
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'lib/internal/encoding.js')
-rw-r--r-- | lib/internal/encoding.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js index 0084c19b904..3fbbbe1a2fe 100644 --- a/lib/internal/encoding.js +++ b/lib/internal/encoding.js @@ -320,7 +320,7 @@ class TextEncoder { [inspect](depth, opts) { validateEncoder(this); if (typeof depth === 'number' && depth < 0) - return opts.stylize('[Object]', 'special'); + return this; var ctor = getConstructorOf(this); var obj = Object.create({ constructor: ctor === null ? TextEncoder : ctor @@ -517,7 +517,7 @@ function makeTextDecoderJS() { [inspect](depth, opts) { validateDecoder(this); if (typeof depth === 'number' && depth < 0) - return opts.stylize('[Object]', 'special'); + return this; var ctor = getConstructorOf(this); var obj = Object.create({ constructor: ctor === null ? TextDecoder : ctor |