Skip to content

Fix test function arguments for whilst/until/during#1224

Merged
aearly merged 4 commits intomasterfrom
whilst-test-params
Jul 10, 2016
Merged

Fix test function arguments for whilst/until/during#1224
aearly merged 4 commits intomasterfrom
whilst-test-params

Conversation

@aearly
Copy link
Copy Markdown
Collaborator

@aearly aearly commented Jul 10, 2016

Closes #1217.

cc @megawac

Comment thread lib/doWhilst.js Outdated
return ++calls <= 1 || test.apply(this, arguments);
}, fn, callback);
export default function doWhilst(iteratee, test, callback) {
callback = callback || noop;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lets once wrap this

@megawac
Copy link
Copy Markdown
Collaborator

megawac commented Jul 10, 2016

👍 I like this resolution. Another option would be to change the test expected definition to

test(callback, arrayofarguments)

@aearly
Copy link
Copy Markdown
Collaborator Author

aearly commented Jul 10, 2016

I think this is the best solution. Either you have a test function that has a different signature the first time its called, you create an async function that doesn't have a callback as its last arg, or you avoid the situation entirely.

@aearly aearly merged commit c148bbe into master Jul 10, 2016
@megawac
Copy link
Copy Markdown
Collaborator

megawac commented Jul 10, 2016

Can you update changelog

@megawac megawac deleted the whilst-test-params branch July 10, 2016 02:00
@aearly
Copy link
Copy Markdown
Collaborator Author

aearly commented Jul 10, 2016

88dab8c :D

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants