Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix custom inspection in new Node.js versions #507

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BridgeAR
Copy link

Newer Node.js versions export a special symbol that should be used
to custom inspect objects. Otherwise the object itself would be
poluted.
This adds the symbol in the most backwards compatible way possible:
it prevents any deprecation message from showing up and behaves just
as before. Otherwise the custom inspection will break in Node.js 11.

I am not sure if it is the best way to tackle this, so I did not add any tests.

Newer Node.js versions export a special symbol that should be used
to custom inspect objects. Otherwise the object itself would be
poluted.
This adds the symbol in the most backwards compatible way possible:
it prevents any deprecation message from showing up and behaves just
as before. Otherwise the custom inspection will break in Node.js 11.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant