-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
Console log WeakSet and WeakMap always empty #19001
Comments
related to #18227 |
This is language related and it is just not possible to inspect We did not yet come to a conclusion how to handle this on the long term and I am going to write a summary of pro / con some time this week. @anantoghosh what kind of warning would you expect? I can not think of a good way to display a warning in this case. |
Maybe a message after using console.log() Although simply mentioning this in the documentation would have been fine. |
At least w.r.t. inspection it should be possible to add a V8 API to peek into them. In fact, it already exists but not in any official capacity:
|
@bnoordhuis that is a very interesting point and opens new possibilities for the other discussion as well. The question for me though is: can this be implemented independent of the engine? |
This adds support for WeakMap and WeakSet entries in `util.inspect`. The output is limited to a maximum entry length of `maxArrayLength`. Fixes: nodejs#19001
Support for inspecting WeakMap and WeakSet was added in master. The |
Currently trying to console.log WeakSet or WeakMap will always display as empty.
I believe I understand why logging them does not work, but node should display a warning and/or should document this behavior.
The text was updated successfully, but these errors were encountered: