My ECMAScript 7 wishlist
brendan at mozilla.org
Thu Sep 25 11:08:17 PDT 2014
Tab Atkins Jr. wrote:
>> Ok, let's not hand-wave mixin syntax, though (Andrea hacks __proto__). What
>> > API do you prefer?
> I'm partial to magic-named functions, but that's probably my
> experience speaking, rather than a more thoughtful opinion.
> Symbol-named magic functions would be better, since we have those and
> most other languages don't.
> Andrea wasn't even hacking __proto__ - they're just adding it to the
> class prototype, so newly constructed objects'll have it.
Right, __noSuchProperty__ -- I was an Andrea post behind.
How is this easier to compose than adding a proxy object on the
prototype chain just before Object.prototype?
>> > Or did you want `sealed class` or other such syntax, and I misunderstood?
> Nah, using superclasses in general is the bad thing here; it doesn't
> compose well without multi-inheritance, which JS likely isn't going to
Adding a magic-name property in the prototype chain is topologically no
different (assuming no collision on the name, and no dead-reckoning by
distance along prototype chain [which is considered brittle already])
from extending the prototype chain.
Instead of asserting "bad thing" and "inappropriate", can you show where
the difference between the two (magic name vs. magic prototype) matters?
More information about the es-discuss