We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using a specific order of attaching callbacks and resolving, one of the fulfillment handlers is called twice for the same promise.
Given the following NodeJS test program:
var Promise = require("bluebird"); var calls = 0; var def = defer(); def.promise.then(function() { console.log("1"); }); def.resolve(); def.promise.then(function() { console.log("2"); calls++; if (calls > 1) { console.log("BLUEBIRD ERROR"); } }).then(function() { console.log("3"); }); function defer() { var resolve, reject; var promise = new Promise(function() { resolve = arguments[0]; reject = arguments[1]; }); return { resolve: resolve, reject: reject, promise: promise }; }
I'd expect the output to be:
1 2 3
but this produces (using Bluebird 2.3.6):
1 2 3 2 BLUEBIRD ERROR
Moving the .resolve() to before the first .then() makes the error disappear.
.resolve()
The text was updated successfully, but these errors were encountered:
bf9f64f
Thnx for the fast fix!
Sorry, something went wrong.
I saw you've bumped the package version on Github, but it's not yet available on NPM. Could you please publish it?
No branches or pull requests
Using a specific order of attaching callbacks and resolving, one of the fulfillment handlers is called twice for the same promise.
Given the following NodeJS test program:
I'd expect the output to be:
but this produces (using Bluebird 2.3.6):
Moving the
.resolve()
to before the first .then() makes the error disappear.The text was updated successfully, but these errors were encountered: