Skip to content

Commit

Permalink
refactor counter updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Jul 1, 2010
1 parent c98bcc4 commit cca54cf
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/vows.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ function addVow(vow) {
var exception, topic, status;

if (vow.callback instanceof String) {
batch.pending ++;
return output('pending');
}

Expand All @@ -98,21 +97,19 @@ function addVow(vow) {
try {
vow.callback.apply(vow.binding || null, args);
output('honored', exception);
batch.honored ++;
} catch (e) {
if (e.name && e.name.match(/AssertionError/)) {
exception = e.toString();
output('broken', exception);
batch.broken ++;
} else {
exception = e.stack || e.message || e.toString() || e;
batch.errored ++;
output('errored', exception);
}
}
}

function output(status, exception) {
batch[status] ++;
vow.status = status;

if (vow.context && batch.lastContext !== vow.context) {
Expand Down

0 comments on commit cca54cf

Please sign in to comment.