purr changed the topic of #elliottcable to: a
<jfhbrook> I've never had that problem
<jfhbrook> ljharb: suppose you had a tree that you were representing with instances of classes, and you wanted to be able to serialize that thing with JSON.stringify
<jfhbrook> ljharb: would you rather have a toJSON method that explicitly filters out properties you don't want to serialize? or would you make those properties non-enumerable?
<ljharb> probably a combination of both.
<ljharb> in both cases you can test it, but an explicit toJSON is probably easier to test.
<ljharb> and also instead of a blacklist, you'd use a whitelist.
<jfhbrook> in the case of a blacklist, and even more so for a whitelist, does it bother you that now there's a big list of properties kicking around somewhere, when you could just inspect the object to get the lists of (enumerable) properties yourself?
<jfhbrook> in the case of using non-enumerable properties, does it bother you that this effects not just serialization but cloning as well?
<jfhbrook> (I made the argument that it was silly to expect a clone operation to pick up non-enumerable properties since it doesn't pick up prototypes either
<jfhbrook> )
<jfhbrook> (but maybe you want to keep those concerns separated?)
<ljharb> no, it doesn't bother me
<ljharb> using reflection means that at runtime, i can change the behavior of the method without actually overwriting the method.
<ljharb> now, that said, i'd write tests that use reflection to verify that the property list is correct.
<ljharb> as for a "clone" - there's no concept in JS of cloning yet.
<ljharb> but, i'd think it would have to grab all own property descriptors (enumerable or not), as well as the [[Prototype]].
<jfhbrook> indeed ljharb which is why I think that expectation is so silly---all you can really do is Object.assign
<jfhbrook> and yeah ljharb there's example code that does something *like* that on mdn
<ljharb> wait, which expectation
<ljharb> you can do `Object.assign` right now
<ljharb> but you can now, thanks to me, do `Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj))`
<ljharb> so it's not that silly.
<jfhbrook> oh that's cool
<jfhbrook> that's in es5? 6?
<ljharb> ES5, ES5, and ES8/ES2017 respectively
<jfhbrook> oh, getOwnPropertyDescriptors is new
<jfhbrook> yeah I see
<ljharb> yup
<ljharb> obv i have the polyfill for it :-p
<jfhbrook> can you use this without polyfilling?
<ljharb> oh sure. it doesn't shim by default.
<jfhbrook> oh word
<ljharb> you have to call `.shim()` to do that.
<jfhbrook> yeah no I see it now
<jfhbrook> cool
<ljharb> i even have an API contract for that :-) https://github.com/es-shims/es-shim-api
<jfhbrook> nerrrrrrd
<jfhbrook> XD
<jfhbrook> very nice though
<ljharb> true story
<ljharb> and ty
<jfhbrook> are people following this? like have you gained traction?
<jfhbrook> man I hate github's new font
<alva> looks like it's trying to use the system font
<ljharb> jfhbrook: which, es-shim-api? only one or two people have taken a real interest so far. but i'm building up to the point where it will be enough of a critical mass that it doesn't need much.
<jfhbrook> nice
embri0n has joined #elliottcable
embri0n has quit [Quit: Leaving...]
brr has quit [Read error: Connection reset by peer]
brr has joined #elliottcable
devyn has joined #elliottcable
thealphanerd has quit [Quit: farewell for now]
thealphanerd has joined #elliottcable
Artemissian has joined #elliottcable
Artemissian has quit [Remote host closed the connection]
Artemissian has joined #elliottcable
Artemissian has quit [Remote host closed the connection]
Artemissian has joined #elliottcable
Artemissian has quit [Remote host closed the connection]
Sgeo has quit [Ping timeout: 276 seconds]
embri0n has joined #elliottcable
gkatsev has joined #elliottcable
embri0n has quit [Quit: Leaving...]
<pikajude> ljharb: we figured it out
<pikajude> the fake redis library we were using adds between 1000 and 2000ms of random delay to every call
<pikajude> that obviously doesn't show up in profiling output
<jfhbrook> lolwut
<purr> lolololol
<jfhbrook> kinda hilarious that it ended up being something so pedestrian pikajude
<pikajude> kinda hilarious
<pikajude> jfhbrook: I've wasted probably 6 hours waiting for this testsuite
Sgeo has joined #elliottcable