On Sep 30, 2011, at 7:56 PM, Brendan Eich wrote:
> class Point extends SomeBaseClass {
> // Constructor.
> constructor(this.x, this.y) {
> class.lastPoint = this;
> }
>
> class:
> // Constant on class.
> const ZERO = new Point(0, 0);
>
> // Data property on class.
> var lastPoint = undefined; // or let
>
> // Nested class (data property on class whose value is a class).
> class Foo {
> ...
> }
>
> prototype:
> // Function on class.
> class add(a, b) {
> return a.add(b);
> }
Oops, misread this -- or didn't read it at all! Arv's right, this is too
confusing. Anyway, easy to fix in my counterproposal: remove the class
prefix-keyword (which is never allowed) and move this "static add method" up
into the class: section.
/be
>
> // Constant on prototype: not supported
> // Data property on prototype: not supported
>
> // Function on prototype.
> add(other) {
> return new Point(this.x + other.x, this.y + other.y);
> }
> }
>
> Supporting a prototype: label to allow alternation for minimal change under
> maintenance is plausible.
>
> For now I think we should minimize and future-proof by forbidding data
> declarations in the prototype section (the default, implicit section without
> any label).
>
> /be
>
>
>
> _______________________________________________
> 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