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

Recursive Observers result in stack overflow #27

Closed
WearyMonkey opened this issue Apr 6, 2012 · 5 comments
Closed

Recursive Observers result in stack overflow #27

WearyMonkey opened this issue Apr 6, 2012 · 5 comments

Comments

@WearyMonkey
Copy link
Contributor

var a = new can.Observe();
var b = new can.Observe({a: a});
a.attr("b", b);

The above code will result in a stack overflow during the event bubbling phase of setting b.

@WearyMonkey
Copy link
Contributor Author

My current workaround, checking for recursion before triggering: c2a002a78214170ed27e1d2dad63fcbda6ba14c0

@justinbmeyer
Copy link
Contributor

checking it out

@justinbmeyer
Copy link
Contributor

Why do you have a recursive observe?

justinbmeyer added a commit that referenced this issue Apr 6, 2012
@justinbmeyer
Copy link
Contributor

I pulled this. Thanks! If you could let me know why you created a recursive observe. I was thinking directed acyclic.

@WearyMonkey
Copy link
Contributor Author

Cheers!

Recursive observes are required for associative models which I talked about here: https://forum.javascriptmvc.com/#Topic/32525000000711090

I have been porting our ActiveRecord style models to CanJS.
You can see the work in progress here: https://github.com/WearyMonkey/can_associate

justinbmeyer added a commit that referenced this issue Jun 1, 2012
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