{"action":"created","issue":{"url":"https://api.github.com/repos/petkaantonov/bluebird/issues/461","labels_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/461/labels{/name}","comments_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/461/comments","events_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/461/events","html_url":"https://github.com/petkaantonov/bluebird/issues/461","id":55086883,"number":461,"title":"Change in Behavior of undefined passed to .spread","user":{"login":"pon","id":689556,"avatar_url":"https://avatars.githubusercontent.com/u/689556?v=3","gravatar_id":"","url":"https://api.github.com/users/pon","html_url":"https://github.com/pon","followers_url":"https://api.github.com/users/pon/followers","following_url":"https://api.github.com/users/pon/following{/other_user}","gists_url":"https://api.github.com/users/pon/gists{/gist_id}","starred_url":"https://api.github.com/users/pon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pon/subscriptions","organizations_url":"https://api.github.com/users/pon/orgs","repos_url":"https://api.github.com/users/pon/repos","events_url":"https://api.github.com/users/pon/events{/privacy}","received_events_url":"https://api.github.com/users/pon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-21T22:27:22Z","updated_at":"2015-01-21T23:01:56Z","closed_at":null,"body":"The following code works in release 2.4.1, but breaks with the error ```Possibly unhandled TypeError: expecting an array, a promise or a thenable``` in 2.4.2. \r\n```\r\nvar Bluebird = require('bluebird');\r\n\r\nreturn Bluebird.resolve().then(function (){\r\n  if (false) {\r\n    return ['a','b'];\r\n  }\r\n}).spread(function (a, b) {\r\n  console.log('here');\r\n});\r\n```\r\n\r\nIs the expected behavior to throw an error when ```.spread``` doesn't receive an array or should it continue with both ```a``` and ```b``` as ```undefined```?"},"comment":{"url":"https://api.github.com/repos/petkaantonov/bluebird/issues/comments/70940022","html_url":"https://github.com/petkaantonov/bluebird/issues/461#issuecomment-70940022","issue_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/461","id":70940022,"user":{"login":"dmethvin","id":157858,"avatar_url":"https://avatars.githubusercontent.com/u/157858?v=3","gravatar_id":"","url":"https://api.github.com/users/dmethvin","html_url":"https://github.com/dmethvin","followers_url":"https://api.github.com/users/dmethvin/followers","following_url":"https://api.github.com/users/dmethvin/following{/other_user}","gists_url":"https://api.github.com/users/dmethvin/gists{/gist_id}","starred_url":"https://api.github.com/users/dmethvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmethvin/subscriptions","organizations_url":"https://api.github.com/users/dmethvin/orgs","repos_url":"https://api.github.com/users/dmethvin/repos","events_url":"https://api.github.com/users/dmethvin/events{/privacy}","received_events_url":"https://api.github.com/users/dmethvin/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T23:01:56Z","updated_at":"2015-01-21T23:01:56Z","body":"In the docs, I would change this:\r\n\r\n> Like calling `.then`, but the fulfillment value or rejection reason is *assumed to be* an array, ...\r\n\r\nto *\"must be an array\"*. When called with invalid data I don't think the caller should assume specific behavior from the API. \r\n\r\nAlternatively you can document the behavior for `undefined` but in that case I would think you'd want to have corresponding unit tests to ensure there were no future regressions. Essentially @pon considered this to be a regression so a docs-only change would not fix that issue."}}