Sightglass Default Adapter Iteration
milonas115 opened this issue · comments
Milonas Media commented
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]();
}