Extend builtins, in particular - ie, `super()` allows your subclass to obtain internal slots it can't otherwise get.
Even if `class` were just sugar, I don't think I see the argument that that's a *good* thing to preserve. On Mon, Jul 23, 2018 at 2:05 PM, Ranando King <[email protected]> wrote: > > > ---------- Forwarded message --------- > From: Ranando King <[email protected]> > Date: Mon, Jul 23, 2018 at 4:04 PM > Subject: Re: proposal: Object Members > To: <[email protected]> > > > You've made that argument before. Exactly what is it in ES6 that you > **can** do with `class` that you cannot do without class? I'd like some > clarification on this. > > On Mon, Jul 23, 2018 at 3:30 PM Jordan Harband <[email protected]> wrote: > >> `class` is already not just syntactic sugar, so that notion isn't >> correct, and shouldn't be maintained. >> >> On Mon, Jul 23, 2018 at 12:38 PM, Ranando King <[email protected]> wrote: >> >>> I've written up a new draft proposal based on my own work with ES5 & ES6 >>> compatible classes with fields. That can be found [here]( >>> https://github.com/rdking/proposal-object-members). I'm already aware >>> of the class-members proposal, but I think it breaks far to many things and >>> doesn't do anything to maintain the notion that "`class` is just syntactic >>> sugar". >>> >>> This proposal is specifically based on the code [here]( >>> https://github.com/rdking/Class.js/tree/master/es6c). I've also got a [ >>> repl.it](https://repl.it/@arkain/Classjs-Compact-Syntax-ES6) that shows >>> the same code running. >>> >>> The idea behind the proposal is that instead of injecting a lot of new >>> logic into how `class` works, let's allow `class` to remain syntactic >>> sugar, and put that extra ability into object declarations instead. Then >>> simply allow `class` to do the same with it's own prototypes. >>> >>> _______________________________________________ >>> es-discuss mailing list >>> [email protected] >>> https://mail.mozilla.org/listinfo/es-discuss >>> >>> >> > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

