Class Method Syntax

# Kevin Smith (13 years ago)

First, thanks for creating a proposal for this. A couple of questions:

  1. Is class method syntax slated for ES6?

  2. I assume that we'd parse "static" the same way we parse "get" and"set", e.g. this is possible:

    class C {
        static() {} // Method "static" on C instance
        static static() {} // Method "static" on C
    }
    
# Rick Waldron (13 years ago)

At the last TC39 meeting, Yehuda Katz presented a proposal that was accepted for ES6:

rwldrn/tc39-notes/blob/master/es6/2013-01/jan-30.md#staticclass

# Erik Arvidsson (13 years ago)
# Domenic Denicola (13 years ago)

Oooh, static getters and setters, nice.

Glad to see the max-min idea seems to be working out well :). Little incremental improvements like this seem natural and a joy to use. Awesome to see them in Traceur so quickly too!

# Brendan Eich (13 years ago)

Yes, this is great! All praise to Arv (and keep putting the C++ engines to shame ;-).

# Kevin Smith (13 years ago)

Are we going with class-side inheritance? It doesn't appear to be addressed in the spec yet (or perhaps I'm just not seeing it).

# Rick Waldron (13 years ago)

I can't find a reference to direct you to, but the answer is yes, and 13.5 is still a wip

# Allen Wirfs-Brock (13 years ago)

On Feb 13, 2013, at 12:35 PM, Kevin Smith wrote:

Are we going with class-side inheritance? It doesn't appear to be addressed in the spec yet (or perhaps I'm just not seeing it).

Yes, in been in the spec. since June 2012.

See 13.5, Runtime Semantics: Class Definition Evaluation, steps 2.f.iv

However, there is a bug. Step 9 needs to pass constructorParent as an optional argument so Property Definition Evaluation, that that routine need to pass it on as the optional functionPrototype parameter when it calls FunctionCreate.

I'll fix this in the next draft.

# Allen Wirfs-Brock (13 years ago)

Oooh, static getters and setters, nice.

Of course, they aren't actually static in any real sense. That's just the keyword. They are just regularly dynamic properties of the class (ie constructor) object.