mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
I quickly experimented with enabling support for get/set syntax. This confirmed my suspicion that these won't be safe without additional work. The "set" fixture example shows how we assume PropertyStore is only a Store effect on the object, but with a setter it needs to be modeled as an arbitrary mutation. If we were to support getters and setters I think we'd need to: * Support `this` syntax (maybe limited to just within object methods) * Enforce that getters cannot mutate any free variables, cannot mutate `this` * Enforce that setters cannot mutate any free variables (but allow mutating `this`). In other words, enforce that you're using getters/setters in a reasonable way that matches our modeling (get is a read, set is a store to the object). [ghstack-poisoned]