What about `static.foo` instead of `class.foo`?
It seems static.foo may be a little bit easier to understand because it just map the static foo declaration.
Another benefit may be it could provide a way to refer the class, for example new static.
Concerns brought up around this are that static is a valid identifier in sloppy mode, and is currently an error inside class bodies, since they're auto-strict:
let static = { x: 1 };
class C {
static x = 2;
static y = static.x;
}
C.y // 1, 2, or "threw before evaluating this line"?
This currently throws; with this proposal using static., it would produce 2, but a user might expect it to produce 1, which would be confusing.
Yeah, it bring ambiguity in sloppy mode, but I would argue that it won't be worse than the similar issues of await/yield. 😂