Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Conversation

@vingiarrusso
Copy link

Addresses #656.

This pull request adds a check to the Q.all() function to make sure it is being passed an array or array-like object.

q.js Outdated
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind replacing All with all() to make the error message more clear?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeError is appropriate here.

@arikon
Copy link

arikon commented Mar 22, 2015

@domenic 👍

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this as opposed to Array.isArray(promises)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Array.isArray, if all() gets passed the arguments object it would be rejected.

@benjamingr
Copy link
Collaborator

What about iterables?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants