Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
process.stderr.write should return true
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Mar 30, 2011
1 parent 6394ba2 commit ed74db0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/node_stdio.cc
Expand Up @@ -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());

Expand All @@ -189,7 +188,7 @@ WriteError (const Arguments& args)
written += (size_t)r;
}

return Undefined();
return True();
}


Expand Down
3 changes: 3 additions & 0 deletions test/simple/test-console.js
Expand Up @@ -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.