WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: super, methods, constructors & Co.

super, methods, constructors & Co.

by Herby Vojčík :: Rate this Message:

| View in Thread

Hello,

reacting to "super only in classes", I'd like to propose widening it
just a little bit:

1. Allow super in every concise methods (in classes, as well as out of
them).
1a. constructor "method" in class definition is also rated as concise
method for the purpose of 1.
2. Allow
   function [name] (args) extends MemberExpression { body }
to be sugar for
   class [name] extends MemberExpression { constructor(args) { body } }
. This allows creating standalone constructor methods that can use super
as well (and by "extends" (even if it is "extends Object") they are
explicitly saying "I am here to construct a class").
2a. In "extends-less" constructor functions, do not allow super.

Herby

P.S.: It was told that there are some problems with super -- what are they?
_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss

 « Return to Thread: super, methods, constructors & Co.