You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make it possible to give externals names/util.inspect.custom #28250
Is your feature request related to a problem? Please describe.
In hyperdivision/hid we use externals as handles for device opaque descriptors, however during debugging it's hard to know what exactly you are working with. I want to preserve the opaqueness of the handles, but it would be nice if I could give these externals a name.
I don't know if this should be another API in N-API, the possibility of setting util.inspect.custom or similar.
Describe alternatives you've considered
object_wrap is another alternative, but comes with much more features and boilerplate than I need. I just want to be able to give human readable names to opaque references for debugging.
I think the only practical solution here would be to print the underlying pointer value if showHidden: true is set. (I would not print the pointer value by default as that may be used in remote code execution attacks.) How does that sound?
Activity
bnoordhuis commentedon Jun 17, 2019
I think an override using
util.inspect.customwould be acceptable. PR welcome.himself65 commentedon Jun 19, 2019
I'm working on this now
addaleax commentedon Feb 20, 2020
I think the only practical solution here would be to print the underlying pointer value if
showHidden: trueis set. (I would not print the pointer value by default as that may be used in remote code execution attacks.) How does that sound?rosaxxny commentedon Jun 13, 2020
Hi, I'd like to work on this.
util: print External address from inspect
util: print External address from inspect
util: print External address from inspect
util: print External address from inspect
util: print External address from inspect