@csuwildcat i forgot the `return this[n] = {}`. I'm hoping the property will be set to a plain object, but I don't know which acts correctly
-
-
Replying to @seanmonstar
@csuwildcat specifically, I'm defining a getter on a prototype, to hopefully lazy-create an object on an instance when/if it's needed.1 reply 0 retweets 0 likes -
Replying to @seanmonstar
@seanmonstar so inside your getter, do a create of a new object and stick it on the instance by redefining the proto via 'value'.1 reply 0 retweets 0 likes -
Replying to @csuwildcat
@csuwildcat yea, that works in both engines, but defineProperty is *SLOW*. Object creation gets faster, property access is far slower1 reply 0 retweets 0 likes -
Replying to @seanmonstar
@seanmonstar or do: return this.__props__[n] ? this.__props__[n] : this.__props__[n] = {}; Assuming you're not against creating a props obj.2 replies 0 retweets 0 likes -
Replying to @csuwildcat
@seanmonstar more simply: return this.__props__[n] || this.__props__[n] = {};1 reply 0 retweets 0 likes -
Replying to @csuwildcat
@csuwildcat yep, I've played with all sorts of versions. I'm trying to get rid of the extra lookups and branches1 reply 0 retweets 0 likes -
Replying to @seanmonstar
@csuwildcat the speed doesn't matter if only done a couple times, but I'm looking at increasing requests per second in nodejs1 reply 1 retweet 0 likes -
Replying to @seanmonstar
@seanmonstar if Chrome is not reassigning a new object *every time* that get is called, I believe it's an implementation bug.1 reply 0 retweets 0 likes -
Replying to @csuwildcat
@csuwildcat Chrome returns a new object, but not set the property on the instance. Firefox sets the property (so get is called only once)1 reply 0 retweets 0 likes
@csuwildcat MDN says defineProp with get-only implies an undefined setter... which Chrome is using and Firefox is not?
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.