wookiehangover / underscore.deferred

jQuery style Deferreds for Underscore
https://github.com/wookiehangover/underscore.deferred
MIT License
225 stars 21 forks source link

Fixed a bug in `when`-method where an array with only one promise was immediately resolved #21

Open jhnns opened 10 years ago

jhnns commented 10 years ago

If when was called with only one promise, the resolver was immediately called:

_.when( [ _.Deferred() ] ).then( function () {
    console.log("2");
} );
console.log("1");

printed

2
1

All tests are running, but I haven't added a test for this bug because I'm not sure where to put it.

Could you please also bump the version and publish it?