archives

« Bugzilla Issues Index

#3223 — static get constructor should be valid


The spec says that

*constructor() {}
get constructor() {}
set constructor(_) {}

are invalid (due to SpecialMethod) but it allows:

static constructor() {}

Due to the rules of specialMethod

static *constructor() {}
static get constructor() {}
static set constructor(_) {}

are all also invalid. For consistency we should allow all forms for static.


I don't see how the spec. currently says that.

The 14.5.1 early errors only apply the "PropName is 'constructor' and SpecialMethod is true" rule to productions:
ClassElement : MethodDefinition

it doesn't apply it for
ClassElement : 'static' MethodDefinition


You are correct. For some reason I thought it would recurse into the `static MethodDefinition`.