{"action":"closed","issue":{"url":"https://api.github.com/repos/tc39/proposal-private-fields/issues/49","repository_url":"https://api.github.com/repos/tc39/proposal-private-fields","labels_url":"https://api.github.com/repos/tc39/proposal-private-fields/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/tc39/proposal-private-fields/issues/49/comments","events_url":"https://api.github.com/repos/tc39/proposal-private-fields/issues/49/events","html_url":"https://github.com/tc39/proposal-private-fields/issues/49","id":176494201,"number":49,"title":"Prohibiting private references outside of classes","user":{"login":"bakkot","id":1653598,"avatar_url":"https://avatars.githubusercontent.com/u/1653598?v=3","gravatar_id":"","url":"https://api.github.com/users/bakkot","html_url":"https://github.com/bakkot","followers_url":"https://api.github.com/users/bakkot/followers","following_url":"https://api.github.com/users/bakkot/following{/other_user}","gists_url":"https://api.github.com/users/bakkot/gists{/gist_id}","starred_url":"https://api.github.com/users/bakkot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bakkot/subscriptions","organizations_url":"https://api.github.com/users/bakkot/orgs","repos_url":"https://api.github.com/users/bakkot/repos","events_url":"https://api.github.com/users/bakkot/events{/privacy}","received_events_url":"https://api.github.com/users/bakkot/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-12T21:49:49Z","updated_at":"2017-01-07T05:26:04Z","closed_at":"2017-01-07T05:26:04Z","body":"In my ideal world, it would be an early error to refer to a private field which is not lexically in scope: e.g. it would be an early error to write `class C { m(){ #a; } }` at the top of a module. However, `class { m(){ #a; } #a; }` should remain legal, so this might be difficult (because we don't know if a field is in scope until later).\n\nBut I think we could at least ban private field references which occur outside of any class body, which is something we know at the time that we see the reference. Depending on how this is done, this could also have the effect of [preventing access to fields from within `eval`](https://github.com/tc39/proposal-private-fields/issues/47).\n"}}
{"actor":{"display_login":"littledan"}}