On 06 Aug 2014, at 21:03 , Brendan Eich <[email protected]> wrote: > Rick Waldron wrote: >> >> I'm cool with super() in methods, I forgot we disallowed naked >> `super`, and my gut says we would support it as equivalent to `this`. >> >> >> To clarify, you don't mean `super === this`, right? > > The alternative is for bare `super` to denote the same-named superclass > method bound to `this`. That enables the equivalence Allen wrote based on > Brett's error citation: > > let superSubmit2 = super; // Error: "Unexpected token ;" > superSubmit2(); // if no Error, this is equivalent to super() > > But that breaks the other equivalence: > > super.method(); ==== do { let s = super; s.method(); } > > So you can see why bare `super` is currently illegal! (Want a better error > message than the one Brett showed.) > > If we make bare `super` an error for now, in hopes of resolving this conflict > of equivalences later, which way do we think we'll resolve? We ought to have > an opinion now.
Given how much `super` does under the hood (if you call a method, you get a super/this hybrid), a stand-alone `super` may give people the wrong idea (and I don’t see how it would be useful). It may be better to provide access to [[HomeObject]] (via Reflect?). -- Dr. Axel Rauschmayer [email protected] rauschma.de
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

