Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always pass a callback as the last function parameter - Closes #2449 #2597

Merged

Conversation

pablitovicente
Copy link
Contributor

What was the problem?

Functions from wait_for.js did not followed NodeJS' convention of accepting a callback at last parameter.

How did I fix it?

  • Changed the functions signatures to accept the callback as last parameter
  • Updated files, when required, that are using wait_for functions

How to test it?

  • build should pass

Review checklist

@pablitovicente pablitovicente added this to the Version 1.4.0 milestone Nov 29, 2018
@MaciejBaj MaciejBaj changed the title Change waitfor functions to expect cb as last parameter - Closes #2449 Always pass a callback as the last function parameter - Closes #2449 Nov 30, 2018
Copy link
Contributor

@MaciejBaj MaciejBaj left a comment

Choose a reason for hiding this comment

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

There is still a lot of (100+) places where callback is being passed not as the last parameter. The pattern I used to find them is: cb,

@pablitovicente
Copy link
Contributor Author

pablitovicente commented Nov 30, 2018

@MaciejBaj this Issue/PR was originally only for wait_for file. Should this now be implemented application wise?

( Also take into account that your pattern will match setImmediate which is correct for it to have the callback as the first parameter if you instead search for , cb, then you get 65 results but the above question about scope change remains regardless of this note)

@MaciejBaj
Copy link
Contributor

@pablitovicente ok, let's leave the wait_for only for now. Please solve the conflicts.

@MaciejBaj MaciejBaj merged commit a914869 into development Dec 6, 2018
@MaciejBaj MaciejBaj deleted the 2449-improve-parameters-for-wait_for-util-functions branch December 6, 2018 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Always pass a callback as the last function parameter
2 participants