{"action":"created","issue":{"url":"https://api.github.com/repos/petkaantonov/bluebird/issues/1253","repository_url":"https://api.github.com/repos/petkaantonov/bluebird","labels_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/1253/labels{/name}","comments_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/1253/comments","events_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/1253/events","html_url":"https://github.com/petkaantonov/bluebird/issues/1253","id":180765876,"number":1253,"title":"Question/Feature Request: `.props` to work on ES6 class instances","user":{"login":"jasonkarns","id":119972,"avatar_url":"https://avatars.githubusercontent.com/u/119972?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonkarns","html_url":"https://github.com/jasonkarns","followers_url":"https://api.github.com/users/jasonkarns/followers","following_url":"https://api.github.com/users/jasonkarns/following{/other_user}","gists_url":"https://api.github.com/users/jasonkarns/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonkarns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonkarns/subscriptions","organizations_url":"https://api.github.com/users/jasonkarns/orgs","repos_url":"https://api.github.com/users/jasonkarns/repos","events_url":"https://api.github.com/users/jasonkarns/events{/privacy}","received_events_url":"https://api.github.com/users/jasonkarns/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-03T22:43:30Z","updated_at":"2016-10-06T12:59:54Z","closed_at":null,"body":"The following does not work because the defined properties are not enumerable:\r\n\r\n```\r\nclass Foo {\r\n  get bar() { return somePromise; }\r\n  get baz() { return otherPromise; }\r\n}\r\n\r\nPromise.props(new Foo()).then(\r\n  ({bar, baz}) => // doesn't resolve these properties\r\n);\r\n```\r\n\r\nPersonally I think it *should* resolve ES5 non-enumerable properties (such as those defined via ES6 classes). Presently, the code is getting the properties to resolve via `Object.keys`, which only lists own enumerable properties.\r\n\r\nWhile we're discussing this, I'd expect .props to resolve inherited properties as well. Is there an intentional reason for only resolving own properties that are enumerable? Or was this just an incidental side effect of using Object.keys for the enumeration?\r\n\r\nDo others see value in this behaving one way or the other?"},"comment":{"url":"https://api.github.com/repos/petkaantonov/bluebird/issues/comments/251954034","html_url":"https://github.com/petkaantonov/bluebird/issues/1253#issuecomment-251954034","issue_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/1253","id":251954034,"user":{"login":"spion","id":502412,"avatar_url":"https://avatars.githubusercontent.com/u/502412?v=3","gravatar_id":"","url":"https://api.github.com/users/spion","html_url":"https://github.com/spion","followers_url":"https://api.github.com/users/spion/followers","following_url":"https://api.github.com/users/spion/following{/other_user}","gists_url":"https://api.github.com/users/spion/gists{/gist_id}","starred_url":"https://api.github.com/users/spion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spion/subscriptions","organizations_url":"https://api.github.com/users/spion/orgs","repos_url":"https://api.github.com/users/spion/repos","events_url":"https://api.github.com/users/spion/events{/privacy}","received_events_url":"https://api.github.com/users/spion/received_events","type":"User","site_admin":false},"created_at":"2016-10-06T12:59:54Z","updated_at":"2016-10-06T12:59:54Z","body":"We can't support getter properties without also supporting all non-enumerable properties. Not only would that break backward compatibility, but once we do that, there is no longer a way for users to hide properties from the `props` method. The capability is easily achieved with a factory function, and will become less ugly for classes via decorators once they become available. So overall I'm -1 on this."}}
{"actor":{"display_login":"spion"}}