Skip to content

Waterfall multiple callback defense#1050

Merged
aearly merged 3 commits into
masterfrom
waterfall-multiple-callback-defense
Mar 8, 2016
Merged

Waterfall multiple callback defense#1050
aearly merged 3 commits into
masterfrom
waterfall-multiple-callback-defense

Conversation

@aearly

@aearly aearly commented Mar 7, 2016

Copy link
Copy Markdown
Collaborator

Closes #815 .

This introduces a breaking change -- previously multiple callbacks would call the rest of the waterfall multiple times, now calling a callback multiple times is an error.

This also fixes a detail related to #696 -- no unnecessary deferrals in waterfall.

@aearly aearly added this to the 2.0 milestone Mar 7, 2016
Comment thread lib/waterfall.js Outdated
return rest(function(err, args) {
function nextTask(args) {
if (taskIndex === tasks.length) {
return cb.apply(null, [null].concat(args));

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.

It's being transpiled so you can do cb(null, ...args)

aearly added a commit that referenced this pull request Mar 8, 2016
@aearly aearly merged commit f51042c into master Mar 8, 2016
@aearly

aearly commented Mar 9, 2016

Copy link
Copy Markdown
Collaborator Author

:( I just noticed that dist/async.js isn't run through babel, just rollup. I'll have to tweak the build if we want to support more than just ES6 modules.

@megawac

megawac commented Mar 9, 2016

Copy link
Copy Markdown
Collaborator

Ah, lets not do that for now in that case

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.

Defend against multiple callbacks in async.waterfall

2 participants