Permalink
Browse files

Added version check to "flush" work around

    In 0.6.x the drain event does not fire, which means
    the process.exit(code) is never executed.
    This prohibits automated scripts from failing on a failed
    test.
  • Loading branch information...
1 parent 6a603fd commit 1d06aa54c87fe011716c7b4b9728be009d878790 @davglass davglass committed Apr 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 javascript/src/cli/CLI-node.js
@@ -44,7 +44,7 @@ YUITest.CLI = {
//Workaround for https://github.com/joyent/node/issues/1669
var flushed = process.stdout.flush && process.stdout.flush();
- if (!flushed) {
+ if (!flushed && (parseFloat(process.versions.node) < 0.5)) {
process.once("drain", function () {
process.exit(code || 0);
});

0 comments on commit 1d06aa5

Please sign in to comment.