[API] track composition before notifying listeners

Track the updated composition of an object before notifying any
listeners.  Otherwise, any composition listener that mutates the
object would cause an infinite loop.

Detected in implementation of the new plot.
This commit is contained in:
Pete Richards 2017-03-07 20:16:16 -08:00
parent beaf8af2e8
commit 910d746002

View File

@ -218,6 +218,8 @@ define([
};
}
listeners.composition = newComposition.map(objectUtils.parseKeyString);
added.forEach(function (addedChild) {
listeners.add.forEach(notify(addedChild));
});
@ -226,7 +228,7 @@ define([
listeners.remove.forEach(notify(removedChild));
});
listeners.composition = newComposition.map(objectUtils.parseKeyString);
};
return DefaultCompositionProvider;