tc39/proposal-decorators

Rename "public" and "private" in metadata?

senocular opened this issue · 2 comments

I noticed this example in the slides:

test('Private field is a number', (assert) => {
    let { private } = MyClass[Symbol.metadata][EXPOSE];
    
    let { get } = private.find((m) => m.name === '#value');
    
    let instance = new MyClass();
    
    assert.equal(typeof get.call(instance), 'number');
})

However this would cause an error (strict mode) because private is a reserved word. Should these be given different names to prevent this from happening?

Related: #417

Maybe publics and privates would be an option?

Closing this issue as after some debate we were not able to come up with better alternatives. There's also #451 which would prevent this issue in general as an option.