Skip to content

Commit

Permalink
don't use a Vow object, just use Object.create()
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed May 2, 2010
1 parent 70ef3a6 commit 8b2afda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/vows.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function addVow(/* description & callback */) {
} else {
vow.callback = args[1], vow.description = args[0];
}
} else if (args[0].constructor.name === 'Vow') {
} else if (args[0].callback && args[0].context) {
vow = args[0];
} else {
throw new(Error)("wrong argument type for addVow()");
Expand Down Expand Up @@ -281,7 +281,7 @@ vows.tell = function (topic, tests) {
return ctx.tests[k] && k !== 'setup';
}).forEach(function (item) {
// Holds the current test or context
vow = new(Vow)(ctx.tests[item], ctx.name, item);
vow = Object.create({callback:ctx.tests[item], context:ctx.name, description:item});

// If we encounter a function, add it to the callbacks
// of the `setup` function, so it'll get called once the
Expand All @@ -308,7 +308,7 @@ vows.tell = function (topic, tests) {
// Check if we're done running the tests
tryFinish(--vows.remaining);
// This is our initial, empty context
})(new(Context)(new(Vow)(vows.tests, null, null), {}));
})(new(Context)({callback:vows.tests, context:null, description:null}, {}));
}
});
return this.promise;
Expand Down

0 comments on commit 8b2afda

Please sign in to comment.