Object.defineProperty(o, n, { get: function() { this[n] = {}; } }) this works in Firefox, and not in Chrome...
@csuwildcat specifically, I'm defining a getter on a prototype, to hopefully lazy-create an object on an instance when/if it's needed.
-
-
@seanmonstar so inside your getter, do a create of a new object and stick it on the instance by redefining the proto via 'value'. -
@csuwildcat yea, that works in both engines, but defineProperty is *SLOW*. Object creation gets faster, property access is far slower - 7 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.