Browse Source

process.stderr.write should return true

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
ed74db01f3
  1. 9
      src/node_stdio.cc
  2. 3
      test/simple/test-console.js

9
src/node_stdio.cc

@ -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();
}

3
test/simple/test-console.js

@ -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"));

Loading…
Cancel
Save