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

fix simple-queue by enforcing only one done() call per push #670

Merged
merged 1 commit into from
Nov 3, 2016

Conversation

nathanial
Copy link
Contributor

This fixes a bug where calling the done() function multiple times within a single push() will keep advancing the queue, and cause it to skip over the other push() functions.

I encountered this bug while trying to use the post-load-delay function. Another part of the code was calling done() multiple times, so phantomas wasn't waiting for the postLoadDelay's done() function to be invoked before exiting.

'should call both callbacks, even though the first callback calls done() multiple times': function(err, callbackOneIsCalled, callbackTwoIsCalled) {
assert.equal(callbackOneIsCalled, true);
assert.equal(callbackTwoIsCalled, true);
}
Copy link
Owner

Choose a reason for hiding this comment

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

Thanks for adding a unit test

@macbre macbre added this to the v1.18 milestone Nov 3, 2016
@macbre macbre merged commit 88c2cad into macbre:devel Nov 3, 2016
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