Skip to content

Commit 4361e42

Browse files
committed
use 'on' instead of 'addListener'
1 parent eb4d50d commit 4361e42

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/vows.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var Suite = require('vows/suite').Suite;
5454

5555
//
5656
// This function gets added to events.EventEmitter.prototype, by default.
57-
// It's essentially a wrapper around `addListener`, which adds all the specification
57+
// It's essentially a wrapper around `on`, which adds all the specification
5858
// goodness.
5959
//
6060
function addVow(vow) {
@@ -63,7 +63,7 @@ function addVow(vow) {
6363
batch.total ++;
6464
batch.vows.push(vow);
6565

66-
return this.addListener("success", function () {
66+
return this.on("success", function () {
6767
var args = Array.prototype.slice.call(arguments);
6868
// If the callback is expecting two or more arguments,
6969
// pass the error as the first (null) and the result after.
@@ -73,7 +73,7 @@ function addVow(vow) {
7373
runTest(args);
7474
vows.tryEnd(batch);
7575

76-
}).addListener("error", function (err) {
76+
}).on("error", function (err) {
7777
if (vow.callback.length >= 2 || !batch.suite.options.error) {
7878
runTest([err]);
7979
} else {
@@ -124,7 +124,7 @@ function addVow(vow) {
124124
// On exit, check that all promises have been fired.
125125
// If not, report an error message.
126126
//
127-
process.addListener('exit', function () {
127+
process.on('exit', function () {
128128
var results = { honored: 0, broken: 0, errored: 0, pending: 0, total: 0 }, failure;
129129

130130
vows.suites.forEach(function (s) {

lib/vows/suite.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ this.Suite.prototype = new(function () {
153153
topic = ctx.emitter;
154154
}
155155

156-
topic.addListener('success', function (val) {
156+
topic.on('success', function (val) {
157157
// Once the topic fires, add the return value
158158
// to the beginning of the topics list, so it
159159
// becomes the first argument for the next topic.
@@ -196,7 +196,7 @@ this.Suite.prototype = new(function () {
196196
// before calling the inner context. Else, just run the inner context
197197
// synchronously.
198198
if (topic) {
199-
topic.addListener("success", function (ctx) {
199+
topic.on("success", function (ctx) {
200200
return function (val) {
201201
return run(new(Context)(vow, ctx, env), lastTopic);
202202
};
@@ -207,7 +207,7 @@ this.Suite.prototype = new(function () {
207207
}
208208
});
209209
// Teardown
210-
topic.addListener("success", function () {
210+
topic.on("success", function () {
211211
if (ctx.tests.teardown) {
212212
ctx.tests.teardown.apply(ctx.env, ctx.topics);
213213
}
@@ -257,7 +257,7 @@ this.Suite.prototype = new(function () {
257257
if (batch.remaining === 0) {
258258
run(batches);
259259
} else {
260-
that.runBatch(batch).addListener('end', function () {
260+
that.runBatch(batch).on('end', function () {
261261
run(batches);
262262
});
263263
}

0 commit comments

Comments
 (0)