Skip to content

Commit

Permalink
Use { index, value } instead of [index, value] for all.
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed Aug 5, 2013
1 parent ca5297a commit 97c9170
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion q.js
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ function all(promises) {
},
deferred.reject,
function (progress) {
deferred.notify([index, progress]);
deferred.notify({ index: index, value: progress });
}
);
}
Expand Down
8 changes: 6 additions & 2 deletions spec/q-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ describe("all", function () {
});
});

it("sends [index, value] progress updates", function () {
it("sends { index, value } progress updates", function () {
var deferred1 = Q.defer();
var deferred2 = Q.defer();

Expand All @@ -1157,7 +1157,11 @@ describe("all", function () {

return Q.all([deferred1.promise, deferred2.promise]).then(
function () {
expect(progressValues).toEqual([[0, "a"], [1, "b"], [0, "c"]]);
expect(progressValues).toEqual([
{ index: 0, value: "a" },
{ index: 1, value: "b" },
{ index: 0, value: "c" }
]);
},
undefined,
function (progressValue) {
Expand Down

0 comments on commit 97c9170

Please sign in to comment.