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
Console log WeakSet and WeakMap always empty #19001
@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?
Support for inspecting WeakMap and WeakSet was added in master. The showHidden option must be set to true and otherwise it will tell that the items were not inspected.
Reacted by Ananto Ghosh, Muhammad Mufid Utomo, xyz 123 and ComplexeExquis
Activity
devsnek commentedon Feb 26, 2018
related to #18227
BridgeAR commentedon Feb 26, 2018
This is language related and it is just not possible to inspect
WeakSet/WeakMap.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.
anantoghosh commentedon Feb 26, 2018
Maybe a message after using console.log()
"WARNING: WeakSet/WeakMap will always appear empty. See link"
Although simply mentioning this in the documentation would have been fine.
Currently, trying to google for this issue does not reveal any information.
bnoordhuis commentedon Feb 26, 2018
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:
BridgeAR commentedon Feb 26, 2018
@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?
BridgeAR commentedon Mar 25, 2018
Support for inspecting WeakMap and WeakSet was added in master. The
showHiddenoption must be set to true and otherwise it will tell that the items were not inspected.