{"action":"created","issue":{"url":"https://api.github.com/repos/tildeio/rsvp.js/issues/433","repository_url":"https://api.github.com/repos/tildeio/rsvp.js","labels_url":"https://api.github.com/repos/tildeio/rsvp.js/issues/433/labels{/name}","comments_url":"https://api.github.com/repos/tildeio/rsvp.js/issues/433/comments","events_url":"https://api.github.com/repos/tildeio/rsvp.js/issues/433/events","html_url":"https://github.com/tildeio/rsvp.js/issues/433","id":176198174,"number":433,"title":"PhantomJS + rejected promise + finally - test failures with assert.deepEqual","user":{"login":"raido","id":659945,"avatar_url":"https://avatars.githubusercontent.com/u/659945?v=3","gravatar_id":"","url":"https://api.github.com/users/raido","html_url":"https://github.com/raido","followers_url":"https://api.github.com/users/raido/followers","following_url":"https://api.github.com/users/raido/following{/other_user}","gists_url":"https://api.github.com/users/raido/gists{/gist_id}","starred_url":"https://api.github.com/users/raido/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raido/subscriptions","organizations_url":"https://api.github.com/users/raido/orgs","repos_url":"https://api.github.com/users/raido/repos","events_url":"https://api.github.com/users/raido/events{/privacy}","received_events_url":"https://api.github.com/users/raido/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-10T19:33:05Z","updated_at":"2016-09-11T23:00:28Z","closed_at":null,"body":"There is an issue with PhantomJS + complex promise chain with multiple catches + finally would fail unit test.\r\n\r\nWhenever finallys are removed, tests will pass - only with finallys it breaks, because PhantomJS adds stack + other information on the thrown user error object.\r\n\r\nhttps://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js#L447\r\nhttps://github.com/tildeio/rsvp.js/blob/v3.1.0/lib/rsvp/promise.js#L492\r\n\r\nI have reproduction of this here - https://github.com/raido/rsvp-phatomjs-bug - look app/services/break-me.js and related unit test.\r\n\r\n@stefanpenner"},"comment":{"url":"https://api.github.com/repos/tildeio/rsvp.js/issues/comments/246210605","html_url":"https://github.com/tildeio/rsvp.js/issues/433#issuecomment-246210605","issue_url":"https://api.github.com/repos/tildeio/rsvp.js/issues/433","id":246210605,"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-11T23:00:28Z","updated_at":"2016-09-11T23:00:28Z","body":"@domenic I'm curious if you have thoughts on this.\r\n\r\nI believe per proposed spec, `finally` should be implemented more or less like:\r\n\r\n```js\r\n    var promise = this;\r\n    var constructor = promise.constructor;\r\n\r\n    return promise.then(function(value) {\r\n      return constructor.resolve(callback()).then(function(){\r\n        return value;\r\n      });\r\n    }, function(reason) {\r\n      return constructor.resolve(callback()).then(function(){\r\n        throw reason;\r\n      });\r\n    });\r\n  }\r\n```\r\n\r\nUnfortunately, phantomjs does bad things, the `throw` in the failure scenario adds additional information onto the `reason`, causing downstream deepEquals to fail, but only in this broken browser. My gut feeling is to say `throw` is the right approach, and its to bad that phantom does the wrong thing. Would you agree?"}}
{"actor":{"display_login":"stefanpenner"}}