{"action":"created","issue":{"url":"https://api.github.com/repos/heycam/webidl/issues/528","repository_url":"https://api.github.com/repos/heycam/webidl","labels_url":"https://api.github.com/repos/heycam/webidl/issues/528/labels{/name}","comments_url":"https://api.github.com/repos/heycam/webidl/issues/528/comments","events_url":"https://api.github.com/repos/heycam/webidl/issues/528/events","html_url":"https://github.com/heycam/webidl/issues/528","id":300747757,"number":528,"title":"ES bindings for constants on Globals","user":{"login":"tobie","id":3392,"avatar_url":"https://avatars3.githubusercontent.com/u/3392?v=4","gravatar_id":"","url":"https://api.github.com/users/tobie","html_url":"https://github.com/tobie","followers_url":"https://api.github.com/users/tobie/followers","following_url":"https://api.github.com/users/tobie/following{/other_user}","gists_url":"https://api.github.com/users/tobie/gists{/gist_id}","starred_url":"https://api.github.com/users/tobie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobie/subscriptions","organizations_url":"https://api.github.com/users/tobie/orgs","repos_url":"https://api.github.com/users/tobie/repos","events_url":"https://api.github.com/users/tobie/events{/privacy}","received_events_url":"https://api.github.com/users/tobie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-27T18:44:57Z","updated_at":"2018-02-27T18:49:43Z","closed_at":null,"author_association":"COLLABORATOR","body":"The [spec says](https://heycam.github.io/webidl/#es-constants):\r\n\r\n> The location of the property is determined as follows:\r\n> 1. If the interface was declared with the [Global] extended attribute, then the property exists on the single object that implements the interface.\r\n> 2. Otherwise, if the interface has an interface prototype object, then the property exists on it.\r\n\r\nIn practice, that's not what's implemented by browsers, however.\r\n\r\nThe only constants I'm aware of on globals are: `Window.TEMPORARY` and `Window.PERSISTENT` (thanks, @TimothyGu, for the heads up). And that's only exposed in Chrome. Maybe there are others?\r\n\r\nIn Chrome, the property is exposed on the interface prototype object, and so there is no special casing even though it's a global.\r\n\r\nProposed resolution here is simply to remove the special casing for [Global].\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/heycam/webidl/issues/comments/368984739","html_url":"https://github.com/heycam/webidl/issues/528#issuecomment-368984739","issue_url":"https://api.github.com/repos/heycam/webidl/issues/528","id":368984739,"user":{"login":"bzbarsky","id":1457979,"avatar_url":"https://avatars1.githubusercontent.com/u/1457979?v=4","gravatar_id":"","url":"https://api.github.com/users/bzbarsky","html_url":"https://github.com/bzbarsky","followers_url":"https://api.github.com/users/bzbarsky/followers","following_url":"https://api.github.com/users/bzbarsky/following{/other_user}","gists_url":"https://api.github.com/users/bzbarsky/gists{/gist_id}","starred_url":"https://api.github.com/users/bzbarsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzbarsky/subscriptions","organizations_url":"https://api.github.com/users/bzbarsky/orgs","repos_url":"https://api.github.com/users/bzbarsky/repos","events_url":"https://api.github.com/users/bzbarsky/events{/privacy}","received_events_url":"https://api.github.com/users/bzbarsky/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T18:49:43Z","updated_at":"2018-02-27T18:49:43Z","author_association":"COLLABORATOR","body":"There's a reason globals are special-cased in terms of property location.  It's because putting things on the prototype object breaks horribly when people try to polyfill and the var shadows the actual property.  That's why methods and attributes are special-cased in terms of location.\r\n\r\nMaybe this is not a problem for constants, but it's hard to tell without actual use cases when people try to make their code work both in browsers with and without the constants.\r\n"}}
{"actor":{"display_login":"bzbarsky"}}