Message from JavaScript discussions

June 2017

— Like await


If you define classes either in global scope or some userspace scope, and have concerns over families/friend classes talking to each other privately, then they shouldn't be in that scope to begin with IMO

— Just supporting syntax for promises

— Yeah, like I said, having a private keyword and actual assignable private members is cool.

— Seriously, how would classes access eachothers members?

— I don't see how that's possible

— I'm sure they mean not runtime string lookup. Turn those named accessors into memory offsets at parse/JIT time.

Message permanent page

— As I understood it, you could access #props only from within the class definition itself


class Foo {
#privateValue = 42;
static getPrivateValue(foo)
return foo.#privateValue;

Foo.getPrivateValue(new Foo()); // >> 42

Message permanent page

— From this

— Accessing private properties using static methods scares me. I don't think you could have pretend private properties that were capable of that without introducing a real class system.

Message permanent page

— It took me awhile to see what was going on there. Very weird behavior and definitely not something people are looking for.

Message permanent page