-
Notifications
You must be signed in to change notification settings - Fork 29.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
util.inspect not checking for loops in {,Weak}Map data #14758
Labels
Comments
rdeforest
changed the title
util.format not checking for loops in {,Weak}Map data
util.inspect not checking for loops in {,Weak}Map data
Aug 11, 2017
Can reproduce on Node.js' REPL: > var m = new Map()
undefined
> m.set('m', m)
Map { 'm' => Map { 'm' => Map { 'm' => [Object] } } } Note, this works fine with a normal object: > var o = {}
undefined
> o.o = o
{ o: [Circular] }
> o
{ o: [Circular] } |
BridgeAR
added a commit
to BridgeAR/node
that referenced
this issue
Aug 11, 2017
4 tasks
aqrln
added a commit
to aqrln/node
that referenced
this issue
Aug 11, 2017
Handle maps and sets with circular references in `util.inspect()` the way objects and arrays are treated in this case. Fixes: nodejs#14758
3 tasks
3 tasks
addaleax
added a commit
that referenced
this issue
Aug 17, 2017
Circular references are conceptually nothing that should be checked for objects (or Sets or Maps) only, but applies to recursive structures in general, so move the `seen` checks into a position where it is part of the recursion itself. Fixes: #14758 PR-URL: #14790 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Ruben Bridgewater <ruben.bridgewater@fintura.de>
MylesBorins
pushed a commit
that referenced
this issue
Sep 10, 2017
Circular references are conceptually nothing that should be checked for objects (or Sets or Maps) only, but applies to recursive structures in general, so move the `seen` checks into a position where it is part of the recursion itself. Fixes: #14758 PR-URL: #14790 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Ruben Bridgewater <ruben.bridgewater@fintura.de>
MylesBorins
pushed a commit
that referenced
this issue
Sep 12, 2017
Circular references are conceptually nothing that should be checked for objects (or Sets or Maps) only, but applies to recursive structures in general, so move the `seen` checks into a position where it is part of the recursion itself. Fixes: #14758 PR-URL: #14790 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Ruben Bridgewater <ruben.bridgewater@fintura.de>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Expected behavior:
Actual behavior:
I know this is a non-trivial problem to solve but it seems worth at least documenting if not solving.
The text was updated successfully, but these errors were encountered: