summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorchocolateboy <chocolate@cpan.org>2018-05-20 21:27:34 +0100
committerMichaël Zasso <targos@protonmail.com>2018-09-15 13:15:15 +0200
commitdadd6e16888baac8fd110432b81f3fd1237be3e1 (patch)
tree37d568677731d1d631a0a4400a68979d5eba93ce /lib
parent16210cad093519b756f2ce8025b29eb9f8d2d046 (diff)
downloadandroid-node-v8-dadd6e16888baac8fd110432b81f3fd1237be3e1.tar.gz
android-node-v8-dadd6e16888baac8fd110432b81f3fd1237be3e1.tar.bz2
android-node-v8-dadd6e16888baac8fd110432b81f3fd1237be3e1.zip
util: use a shared symbol for util.inspect.custom
Define `util.inspect.custom` as `Symbol.for("nodejs.util.inspect.custom")` rather than `Symbol("util.inspect.custom")`. This allows `inspect` hooks to easily/safely be defined in non-Node.js environments. Fixes: https://github.com/nodejs/node/issues/20821 Refs: https://github.com/nodejs/node/pull/22684 PR-URL: https://github.com/nodejs/node/pull/20857 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/util.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/util.js b/lib/internal/util.js
index 5cb1b281ba..9a102907ee 100644
--- a/lib/internal/util.js
+++ b/lib/internal/util.js
@@ -400,7 +400,7 @@ module.exports = {
// Symbol used to provide a custom inspect function for an object as an
// alternative to using 'inspect'
- customInspectSymbol: Symbol('util.inspect.custom'),
+ customInspectSymbol: Symbol.for('nodejs.util.inspect.custom'),
// Used by the buffer module to capture an internal reference to the
// default isEncoding implementation, just in case userland overrides it.