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

can.Map stack exceeded on circular data structures #521

Closed
zkat opened this Issue Oct 31, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@zkat
Contributor

zkat commented Oct 31, 2013

Summary

If you pass a circular object to can.Map, it'll blow the stack.

Steps

  1. Create a circular JS object by assigning a reference of itself to it.
  2. Pass it to can.Map
  3. watch the fireworks (in your console)

Notes

There's an example of the effects of this here: http://jsfiddle.net/NMBMh/2/.

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Nov 1, 2013

Contributor

This is partially because

foo = {}
foo.foo = foo;
$.extend(true,{}, foo)

breaks. This might result in a won't fix as it would require replacing some jQuery functionality with our own. It does support circular structures, just not on initialization.

Contributor

justinbmeyer commented Nov 1, 2013

This is partially because

foo = {}
foo.foo = foo;
$.extend(true,{}, foo)

breaks. This might result in a won't fix as it would require replacing some jQuery functionality with our own. It does support circular structures, just not on initialization.

justinbmeyer added a commit that referenced this issue Nov 1, 2013

Merge pull request #523 from bitovi/cycles-in-maps
supports cycles in maps and fixes #521
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment