Would it be possible to have a shorthand for defining a inner class scope? Languages like Java and Ruby allow for an inner scope to the class definition.
class Foo {
class Bar {}
method() {
let innerInstance = new Bar(); // OK
}
}
let outerInstance = new Bar(); // throws ReferenceError
Currently the supported syntax is
class Foo {
Bar = class Bar {};
method() {
let innerInstance = new this.Bar(); // OK
}
}
// Is not scoped and exposed publicly
let outerInstance = new (new Foo()).Bar();
I felt the former syntax read much better and supported or could encourage others to make more modular OOP designs without exposing implementation details.