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
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to