Permalink
Browse files

process.stderr.write should return true

  • Loading branch information...
1 parent 6394ba2 commit ed74db01f35c525d90a5d1ec93f96a7602ca2711 @ry ry committed Mar 30, 2011
Showing with 7 additions and 5 deletions.
  1. +4 −5 src/node_stdio.cc
  2. +3 −0 test/simple/test-console.js
View
@@ -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();
}
@@ -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"));

0 comments on commit ed74db0

Please sign in to comment.