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
Backport-PR-URL: https://github.com/nodejs/node/pull/23039
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>
parent
077e7e0c
Please register or sign in to comment