{"action":"created","issue":{"url":"https://api.github.com/repos/stefanpenner/es6-promise/issues/232","repository_url":"https://api.github.com/repos/stefanpenner/es6-promise","labels_url":"https://api.github.com/repos/stefanpenner/es6-promise/issues/232/labels{/name}","comments_url":"https://api.github.com/repos/stefanpenner/es6-promise/issues/232/comments","events_url":"https://api.github.com/repos/stefanpenner/es6-promise/issues/232/events","html_url":"https://github.com/stefanpenner/es6-promise/issues/232","id":176296209,"number":232,"title":"include proposed `Promise.prototype.finally`","user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-12T05:17:55Z","updated_at":"2016-09-12T21:05:49Z","closed_at":null,"body":"basically just:\r\n\r\n```js\r\n/**\r\n  `finally` will be invoked regardless of the promise's fate just as native\r\n  try/catch/finally behaves\r\n  Synchronous example:\r\n\r\n  findAuthor() {\r\n    if (Math.random() > 0.5) {\r\n      throw new Error();\r\n    }\r\n    return new Author();\r\n  }\r\n  try {\r\n    return findAuthor(); // succeed or fail\r\n  } catch(error) {\r\n    return findOtherAuther();\r\n  } finally {\r\n    // always runs\r\n    // doesn't affect the return value\r\n  }\r\n\r\n  Asynchronous example:\r\n\r\n  findAuthor().catch(function(reason){\r\n    return findOtherAuther();\r\n  }).finally(function(){\r\n    // author was either found, or not\r\n  });\r\n\r\n  @method finally\r\n  @param {Function} callback\r\n  @return {Promise}\r\n*/\r\n  finally(callback) {\r\n    let promise = this;\r\n    let constructor = promise.constructor;\r\n\r\n    return promise.then(value => constructor.resolve(callback()).then(() => value),\r\n                  reason => constructor.resolve(callback()).then(() => { throw reason; }));\r\n  }\r\n```\r\n\r\nQuestions:\r\n\r\n* should 4.0.0's `es6-promise/auto` polyfill  the whole promise, or just `finally` if `finally` is not present?\r\n* should we wait a-bit longer or  is the risk sufficiently low to just :shipit: cc @domenic "},"comment":{"url":"https://api.github.com/repos/stefanpenner/es6-promise/issues/comments/246493284","html_url":"https://github.com/stefanpenner/es6-promise/issues/232#issuecomment-246493284","issue_url":"https://api.github.com/repos/stefanpenner/es6-promise/issues/232","id":246493284,"user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"created_at":"2016-09-12T21:05:49Z","updated_at":"2016-09-12T21:05:49Z","body":"@ljharb I'll keep it in a branch, and :shipit: when we hit stage 3.."}}
{"actor":{"display_login":"stefanpenner"}}