Skip to content

Promise.map should generate an error if 'options' is provided but not an object #1097

Description

@Unibozu
  1. What version of bluebird is the issue happening on? 3.3.5
  2. What platform and version? NodeJS 5.7.1

Promise.map() takes as a third parameter an options object accepting a single property to define the iteration concurrency limit. Because there is only one option I often mistake this object as a concurrency argument and provide an integer instead of the right object.

Bluebird silently ignores the bad parameter and keeps an infinite concurrency witch causes unknown stress to the server if iterating over a huge dataset. It should throw an exception if the parameter is truthy but not an object to avoid such mistakes.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions