Sep 27 meeting notes
Brendan Eich
brendan at mozilla.com
Fri Sep 30 11:00:18 PDT 2011
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
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110930/09ae8a5f/attachment.html>
More information about the es-discuss
mailing list