Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename "public" and "private" in metadata? #421

Closed
senocular opened this issue Aug 6, 2021 · 2 comments
Closed

Rename "public" and "private" in metadata? #421

senocular opened this issue Aug 6, 2021 · 2 comments

Comments

@senocular
Copy link
Contributor

senocular commented Aug 6, 2021

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

@Hawmex
Copy link

Hawmex commented Aug 7, 2021

Maybe publics and privates would be an option?

@pzuraq
Copy link
Collaborator

pzuraq commented Mar 27, 2022

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.

@pzuraq pzuraq closed this as completed Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants