tc39 / proposal-static-class-features

The static parts of new class features, in a separate proposal
https://arai-a.github.io/ecma262-compare/?pr=1668
127 stars 27 forks source link

Why do we disallow static fields named "constructor"? #35

Closed zenparsing closed 6 years ago

zenparsing commented 6 years ago

There is an early error for the following case:

class C {
  static constructor;
}

But there is no existing early error for this:

class C {
  static constructor() {}
}

Why is the first an early error?

ljharb commented 6 years ago

My question is more, why is the second not an early error :-/

littledan commented 6 years ago

This is to leave room for a proposal from @erights, see https://github.com/erights/Orthogonal-Classes/commit/93bd1c4a19acd3155b62b6f27e94f9ef98a13a11

zenparsing commented 6 years ago

Got it. Thanks!