Shopify/batman — Issue #177: Calling `set` from inside accessors can introduce a cyclic dependency
Author: pvande
Created: 2011-10-12 06:49:09+00:00
State: open

jsFiddle: http://jsfiddle.net/zbQMZ/

This happens because both `set` and `unset` (via `Property::setValue` and `Property::unsetValue`, respectively) unconditionally call `Property::refresh`, which in turn calls `Property::getValue`, registering the `set` property as an update source.

But wait, there's more! After calling `Property::getValue`, the current value and the previous value are compared, and if a change in value is deemed to have occurred, all observers (read: dependent properties) are fired.

(Fun fact: this came to me while I was falling asleep. I really need to get out more...)