Skip to content
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
Closed

can.Map stack exceeded on circular data structures #521

zkat opened this issue Oct 31, 2013 · 1 comment
Milestone

Comments

@zkat
Copy link
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
Copy link
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.

justinbmeyer added a commit that referenced this issue Nov 1, 2013
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants