Skip to content

Commit 96a17a2

Browse files
committed
use instanceof to check if the return value from a topic is an EventEmitter
Signed-off-by: seebees <seebees@gmail.com>
1 parent 3e98285 commit 96a17a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/vows/suite.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ this.Suite.prototype = new(function () {
144144

145145
// If the topic doesn't return an event emitter (such as a promise),
146146
// we create it ourselves, and emit the value on the next tick.
147-
if (! (topic && topic.constructor === events.EventEmitter)) {
147+
if (! (topic instanceof events.EventEmitter)) {
148148
ctx.emitter = new(events.EventEmitter);
149149

150150
if (! ctx._callback) {

0 commit comments

Comments
 (0)