process.stderr.write should return true
authorRyan Dahl <ry@tinyclouds.org>
Wed, 30 Mar 2011 22:53:07 +0000 (15:53 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 30 Mar 2011 22:53:07 +0000 (15:53 -0700)
src/node_stdio.cc
test/simple/test-console.js

index 00bdd86..f744e3f 100644 (file)
@@ -165,13 +165,12 @@ static Handle<Value> IsATTY (const Arguments& args) {
 
 
 /* STDERR IS ALWAY SYNC ALWAYS UTF8 */
-static Handle<Value>
-WriteError (const Arguments& args)
-{
+static Handle<Value> WriteError (const Arguments& args) {
   HandleScope scope;
 
-  if (args.Length() < 1)
+  if (args.Length() < 1) {
     return Undefined();
+  }
 
   String::Utf8Value msg(args[0]->ToString());
 
@@ -189,7 +188,7 @@ WriteError (const Arguments& args)
     written += (size_t)r;
   }
 
-  return Undefined();
+  return True();
 }
 
 
index adde724..b7def76 100644 (file)
@@ -36,3 +36,6 @@ global.process.stdout.write = stdout_write;
 assert.equal('foo\n', strings.shift());
 assert.equal('foo bar\n', strings.shift());
 assert.equal('foo bar hop\n', strings.shift());
+
+
+assert.equal(true, process.stderr.write("hello world"));