{"action":"created","issue":{"url":"https://api.github.com/repos/tc39/proposal-class-fields/issues/179","repository_url":"https://api.github.com/repos/tc39/proposal-class-fields","labels_url":"https://api.github.com/repos/tc39/proposal-class-fields/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/tc39/proposal-class-fields/issues/179/comments","events_url":"https://api.github.com/repos/tc39/proposal-class-fields/issues/179/events","html_url":"https://github.com/tc39/proposal-class-fields/issues/179","id":389095625,"node_id":"MDU6SXNzdWUzODkwOTU2MjU=","number":179,"title":"Branding guarantees do not match web platform classes, due to return override","user":{"login":"domenic","id":617481,"node_id":"MDQ6VXNlcjYxNzQ4MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/617481?v=4","gravatar_id":"","url":"https://api.github.com/users/domenic","html_url":"https://github.com/domenic","followers_url":"https://api.github.com/users/domenic/followers","following_url":"https://api.github.com/users/domenic/following{/other_user}","gists_url":"https://api.github.com/users/domenic/gists{/gist_id}","starred_url":"https://api.github.com/users/domenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domenic/subscriptions","organizations_url":"https://api.github.com/users/domenic/orgs","repos_url":"https://api.github.com/users/domenic/repos","events_url":"https://api.github.com/users/domenic/events{/privacy}","received_events_url":"https://api.github.com/users/domenic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":39,"created_at":"2018-12-10T01:28:24Z","updated_at":"2018-12-12T22:57:06Z","closed_at":null,"author_association":"MEMBER","body":"Consider the following:\r\n\r\n```js\r\nclass Base {}\r\nclass Ex extends Base {\r\n  #foo = 1;\r\n  isExample() {\r\n    return this.#foo === 1;\r\n  }\r\n}\r\nconst o = {};\r\nEx.__proto__ = function() { return o; };\r\nnew Ex;\r\nEx.prototype.isExample.call(o); // => true\r\n```\r\n\r\nNow consider the analogous setup with the `Node` and `Text` classes:\r\n\r\n```js\r\nconst o = {};\r\nText.__proto__ = function () { return o; };\r\nnew Text();\r\n\r\nText.prototype.splitText.call(o); // throws!!\r\n```\r\n\r\nor, using ES262 classes:\r\n\r\n```js\r\nconst o = {};\r\nUint8Array.__proto__ = function () { return o; };\r\nnew Uint8Array();\r\n\r\nArrayBuffer.isView(o); // false\r\n```\r\n\r\nThis mismatch is worrying. It means that we cannot use private fields for self-hosting any classes involved in inheritance hierarchies.\r\n\r\nI'm not sure what a good fix would be, but it seems like we should investigate what can be done here."},"comment":{"url":"https://api.github.com/repos/tc39/proposal-class-fields/issues/comments/446775903","html_url":"https://github.com/tc39/proposal-class-fields/issues/179#issuecomment-446775903","issue_url":"https://api.github.com/repos/tc39/proposal-class-fields/issues/179","id":446775903,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Njc3NTkwMw==","user":{"login":"littledan","id":189835,"node_id":"MDQ6VXNlcjE4OTgzNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/189835?v=4","gravatar_id":"","url":"https://api.github.com/users/littledan","html_url":"https://github.com/littledan","followers_url":"https://api.github.com/users/littledan/followers","following_url":"https://api.github.com/users/littledan/following{/other_user}","gists_url":"https://api.github.com/users/littledan/gists{/gist_id}","starred_url":"https://api.github.com/users/littledan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littledan/subscriptions","organizations_url":"https://api.github.com/users/littledan/orgs","repos_url":"https://api.github.com/users/littledan/repos","events_url":"https://api.github.com/users/littledan/events{/privacy}","received_events_url":"https://api.github.com/users/littledan/received_events","type":"User","site_admin":false},"created_at":"2018-12-12T22:57:06Z","updated_at":"2018-12-12T22:57:06Z","author_association":"MEMBER","body":"@domenic Maybe you can be more specific. Is there an example of a subclass that does the equivalent of adding a private field that I could look into more? I was mostly thinking of having a strong analogy to private fields/internal slots defined in base classes, which I think this proposal has."}}
{"actor":{"display_login":"littledan"}}