-
Notifications
You must be signed in to change notification settings - Fork 6
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
ObserverCallbacks continues growing with dead callback #18
Comments
The spec only describes semantics. Things like GC is unobservable. An implementation needs to make sure that it cleans up unreachable objects. It is possible that we need to make something clearer in the spec here? |
The spec uses the term "List" which is an implementation specific data structure. |
(I posted a comment but it was unclear. I rewrite.) I've thought even if internal property is not directly accessible via ECMAScript code, but acts like usual ECMAScript Object (especially reachability manner in this case). Is it incorrect? If I misunderstand, who holds strong referrence?
If P.S.
Well.., I'll read the spec again carefully. |
Object.observe()
appends the callback to[[ObserverCallbacks]]
.On the other hand,
Object.unobserve()
does not care about[[ObserverCallbacks]]
.Then
[[ObserverCallbacks]]
continues growing big with unused callback while the system runs.I implemented current specification straight forward, then I encountered this problem.
I think
Object.unobserve()
should remove it.Or, somewhere in delivering steps (the end of AllChangeRecords ?) might be better point.
because records in
[[PendingChangeRecords]]
could remain ifObject.unobserve()
immediately removes.The text was updated successfully, but these errors were encountered: