Skip to content

Commit 006476f

Browse files
committed
[v0.6] Handle stdout suppressing correctly
In node v0.5.x `process.stdout` is a getter, so assigning to it makes no difference (see nodejs/node-v0.x-archive#1878 - thanks @bnoordhuis).
1 parent 87462e6 commit 006476f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bin/vows

+5-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,11 @@ while (arg = argv.shift()) {
168168
}
169169

170170
if (options.supressStdout) {
171-
_reporter.setStream && _reporter.setStream(process.stdout);
172-
process.stdout = fs.createWriteStream('/dev/null');
171+
_reporter.setStream && _reporter.setStream(process.stdout);
172+
var devNullStream = fs.createWriteStream('/dev/null');
173+
process.__defineGetter__('stdout', function () {
174+
return devNullStream;
175+
});
173176
}
174177

175178
if (options.watch) {

0 commit comments

Comments
 (0)