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

Sightglass Default Adapter Iteration #710

Open
milonas115 opened this issue Mar 13, 2017 · 0 comments
Open

Sightglass Default Adapter Iteration #710

milonas115 opened this issue Mar 13, 2017 · 0 comments

Comments

@milonas115
Copy link

milonas115 commented Mar 13, 2017

Iterate the "change" callbacks backwards. Changes to the callbacks by custom binders will cause some parts of the loop to try to call an "undefined" function, or in the weird case, to skip a callback entirely.

if (weakmap[r].callbacks[k] instanceof Array)
{
	for(var i=weakmap[r].callbacks[k].length-1;i>=0;i--)
		weakmap[r].callbacks[k][i]();
}
if (callbacks[keypath])
{
	for(var i=callbacks[keypath].length-1;i>=0;i--)
		callbacks[keypath][i]();
}
@milonas115 milonas115 changed the title SightGlass Default Adapter Iteration Sightglass Default Adapter Iteration Mar 13, 2017
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

1 participant