Re: setPrototypeOf vs obj.__proto__ assignment

2014-04-07 Thread K. Gadd
Is my understanding correct that __proto__/setPrototypeOf are still required if you want to do things like that with instances of Function? Or did Function's constructor finally get patched to let you set a prototype? On Mon, Apr 7, 2014 at 2:26 AM, David Bruant bruan...@gmail.com wrote: Le

Re: setPrototypeOf vs obj.__proto__ assignment

2014-04-07 Thread Andrea Giammarchi
nope, if you have a dict and you use __proto__ nothing should happen, that's why Object.setPrototypeOf is suggested: it's more powerful + it does not show up in getOwnPropertyNames as '__proto__' does so it's shenanigans and errors prone. __proto__ is not even more elegant than

Re: setPrototypeOf vs obj.__proto__ assignment

2014-04-07 Thread John Barton
On Mon, Apr 7, 2014 at 10:51 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: .. It feels like everyone uses `__proto__` on daily basis while ES6 promotes classes ... so either `__proto__` is not a real world use case, or `class` landed for no reason, IMO. You are correct, lots of

Re: setPrototypeOf vs obj.__proto__ assignment

2014-04-07 Thread Andrea Giammarchi
that's why it's the preferred choice ... otherwise we keep promoting and trapping developers behind a broken pattern. If we keep saying just use `__proto__` code won't ever migrate but it's been discussed that in some case `__proto__` is a very problematic keyword.

Re: Rewinding iterators

2014-04-07 Thread Marcus Stade
Thanks Allen! When reading the issue, I can't quite make out what the reasoning is for setting this constraint on the iterator protocol. Locking down the behavior of Map/Set/Array iterators is fine I suppose (although I'd argue against the permanently closed behavior) but I reckon it seems a bit

Re: Rewinding iterators

2014-04-07 Thread Allen Wirfs-Brock
On Apr 7, 2014, at 12:06 PM, Marcus Stade wrote: Thanks Allen! When reading the issue, I can't quite make out what the reasoning is for setting this constraint on the iterator protocol. Locking down the behavior of Map/Set/Array iterators is fine I suppose (although I'd argue against the

Re: Rewinding iterators

2014-04-07 Thread C. Scott Ananian
It would be worthwhile to state that iterators returned by 'built-in' functions always have the no zombies property (once done, stays done), even though that can't be enforced on user-supplied iterators. Be generous in what you accept, rigorous in what you emit. --scott On Mon, Apr 7, 2014 at

Re: typed objects and value types

2014-04-07 Thread Waldemar Horwat
On 04/02/2014 07:32 AM, Niko Matsakis wrote: I just wanted to let people on es-discuss know about two of my recent blog posts concerning typed objects. The first is a kind of status report: http://smallcultfollowing.com/babysteps/blog/2014/04/01/typed-objects-status-report/ and the second

Re: setPrototypeOf vs obj.__proto__ assignment

2014-04-07 Thread Andrea Giammarchi
just for topic and documentation sake ... On Mon, Apr 7, 2014 at 11:02 AM, John Barton johnjbar...@google.com wrote: on platforms without setPrototypeOf(), it's advantages are not relevant. jjb this works in Firefox since quite a while, and probably some other engine that supports