{"action":"created","issue":{"url":"https://api.github.com/repos/google/closure-compiler/issues/2833","repository_url":"https://api.github.com/repos/google/closure-compiler","labels_url":"https://api.github.com/repos/google/closure-compiler/issues/2833/labels{/name}","comments_url":"https://api.github.com/repos/google/closure-compiler/issues/2833/comments","events_url":"https://api.github.com/repos/google/closure-compiler/issues/2833/events","html_url":"https://github.com/google/closure-compiler/issues/2833","id":301494119,"number":2833,"title":"ES6+ to ES5 transpilation should disallow get name() and set name() properties","user":{"login":"patstuart","id":8353778,"avatar_url":"https://avatars2.githubusercontent.com/u/8353778?v=4","gravatar_id":"","url":"https://api.github.com/users/patstuart","html_url":"https://github.com/patstuart","followers_url":"https://api.github.com/users/patstuart/followers","following_url":"https://api.github.com/users/patstuart/following{/other_user}","gists_url":"https://api.github.com/users/patstuart/gists{/gist_id}","starred_url":"https://api.github.com/users/patstuart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patstuart/subscriptions","organizations_url":"https://api.github.com/users/patstuart/orgs","repos_url":"https://api.github.com/users/patstuart/repos","events_url":"https://api.github.com/users/patstuart/events{/privacy}","received_events_url":"https://api.github.com/users/patstuart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"MatrixFrog","id":244381,"avatar_url":"https://avatars0.githubusercontent.com/u/244381?v=4","gravatar_id":"","url":"https://api.github.com/users/MatrixFrog","html_url":"https://github.com/MatrixFrog","followers_url":"https://api.github.com/users/MatrixFrog/followers","following_url":"https://api.github.com/users/MatrixFrog/following{/other_user}","gists_url":"https://api.github.com/users/MatrixFrog/gists{/gist_id}","starred_url":"https://api.github.com/users/MatrixFrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatrixFrog/subscriptions","organizations_url":"https://api.github.com/users/MatrixFrog/orgs","repos_url":"https://api.github.com/users/MatrixFrog/repos","events_url":"https://api.github.com/users/MatrixFrog/events{/privacy}","received_events_url":"https://api.github.com/users/MatrixFrog/received_events","type":"User","site_admin":false},"assignees":[{"login":"MatrixFrog","id":244381,"avatar_url":"https://avatars0.githubusercontent.com/u/244381?v=4","gravatar_id":"","url":"https://api.github.com/users/MatrixFrog","html_url":"https://github.com/MatrixFrog","followers_url":"https://api.github.com/users/MatrixFrog/followers","following_url":"https://api.github.com/users/MatrixFrog/following{/other_user}","gists_url":"https://api.github.com/users/MatrixFrog/gists{/gist_id}","starred_url":"https://api.github.com/users/MatrixFrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatrixFrog/subscriptions","organizations_url":"https://api.github.com/users/MatrixFrog/orgs","repos_url":"https://api.github.com/users/MatrixFrog/repos","events_url":"https://api.github.com/users/MatrixFrog/events{/privacy}","received_events_url":"https://api.github.com/users/MatrixFrog/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-03-01T17:34:31Z","updated_at":"2018-03-05T22:51:27Z","closed_at":null,"author_association":"NONE","body":"Take the following example:\r\n\r\n```\r\nclass Foo {\r\n    get name() {\r\n        return \"bar\";\r\n    }\r\n}\r\n```\r\n\r\nThis transpiles to: ([link](https://closure-compiler.appspot.com/home#code%3D%252F%252F%2520%253D%253DClosureCompiler%253D%253D%250A%252F%252F%2520%2540language_out%2520ES5%250A%252F%252F%2520%253D%253D%252FClosureCompiler%253D%253D%250A%250A%252F%252F%2520ADD%2520YOUR%2520CODE%2520HERE%250Aclass%2520Foo%2520%257B%250A%2520%2520%2520%2520get%2520name%28%29%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520return%2520%2522bar%2522%253B%250A%2520%2520%2520%2520%257D%250A%257D%250A%250A))\r\n```\r\nvar Foo=function(){};\r\n$jscomp.global.Object.defineProperties(Foo , {\r\n    name: {\r\n        configurable: !0,\r\n        enumerable: !0,\r\n        get: function() {\r\n            return \"bar\"\r\n        }\r\n    }\r\n});\r\n```\r\n\r\n\r\nThis is technically incorrect ES5, since the name property is not supposed to be configurable. According to [this](https://github.com/ariya/phantomjs/issues/13895), this might break PhantomJs. We found this issue internally after a Safari 9 iPad threw the following error: \r\n`TypeError: Attempting to change configurable attribute of unconfigurable property.` (I could not reproduce this error outside of our testing environment, so I'm guessing this is a browser quirk).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/google/closure-compiler/issues/comments/370596410","html_url":"https://github.com/google/closure-compiler/issues/2833#issuecomment-370596410","issue_url":"https://api.github.com/repos/google/closure-compiler/issues/2833","id":370596410,"user":{"login":"MatrixFrog","id":244381,"avatar_url":"https://avatars0.githubusercontent.com/u/244381?v=4","gravatar_id":"","url":"https://api.github.com/users/MatrixFrog","html_url":"https://github.com/MatrixFrog","followers_url":"https://api.github.com/users/MatrixFrog/followers","following_url":"https://api.github.com/users/MatrixFrog/following{/other_user}","gists_url":"https://api.github.com/users/MatrixFrog/gists{/gist_id}","starred_url":"https://api.github.com/users/MatrixFrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatrixFrog/subscriptions","organizations_url":"https://api.github.com/users/MatrixFrog/orgs","repos_url":"https://api.github.com/users/MatrixFrog/repos","events_url":"https://api.github.com/users/MatrixFrog/events{/privacy}","received_events_url":"https://api.github.com/users/MatrixFrog/received_events","type":"User","site_admin":false},"created_at":"2018-03-05T22:51:27Z","updated_at":"2018-03-05T22:51:27Z","author_association":"MEMBER","body":"It looks like `configurable: true` is actually correct: `Object.getOwnPropertyDescriptor({get name() { return 'name'; }}, 'name').configurable` returns true. So I guess this is a bug in Safari, or in PhantomJS?"}}
{"actor":{"display_login":"MatrixFrog"}}