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 constructor is observable #2220
Comments
Yes. Seems like a bug. Sent from my iPhone
|
my best is there is a call to call |
Yeah, this doesn't happen with just a compute, so it's a can.Map init issue. I can do this as a workaround: var c = can.compute(function() {
var map;
can.__notObserve(function() {
map = new can.Map();
})();
return map;
}); Tracing was pretty easy. During setup, it sets the data (an empty object in this case) and that eventually leads to |
The problem is that the setup method calls into I'd say this is a general bug with tripping an observer hook during the (Setters are never supposed to be observed, right? Just getters...) |
@rjgotten Yeah, setters shouldn't be observable. Going to work on a fix now. Thanks! |
If I define a compute that returns a
new can.Map()
, changes to the map cause the compute to re-execute.http://jsbin.com/suxayikepu/edit?js,console
Shouldn't the compute in this example only ever be evaluated once? It appears to be binding to its own return value.
The text was updated successfully, but these errors were encountered: