Message from JavaScript discussions

June 2017

— 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.

— 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

— Wait, wat

— You can access private props from static methods??

— It lets any instance of foo reference private members of any other instance of foo, yes

— Uuuuuuuuhhhh

— Ugly