This file was deleted.

This file was deleted.

@@ -72,13 +72,13 @@ exports.puts = function() {


exports.debug = function(x) {
process.binding('stdio').writeError('DEBUG: ' + x + '\n');
process.writeError('DEBUG: ' + x + '\n');
};


var error = exports.error = function(x) {
for (var i = 0, len = arguments.length; i < len; ++i) {
process.binding('stdio').writeError(arguments[i] + '\n');
process.writeError(arguments[i] + '\n');
}
};

@@ -39,10 +39,7 @@
'lib/sys.js',
'lib/timers.js',
'lib/tls.js',
'lib/tty_legacy.js',
'lib/tty_posix.js',
'lib/tty_uv.js',
'lib/tty_win32.js',
'lib/tty.js',
'lib/url.js',
'lib/util.js',
'lib/vm.js',
@@ -109,7 +106,6 @@
'src/node_os.h',
'src/node_root_certs.h',
'src/node_script.h',
'src/node_stdio.h',
'src/node_string.h',
'src/node_version.h',
'src/pipe_wrap.h',
@@ -153,7 +149,6 @@
[ 'OS=="win"', {
'sources': [
'src/platform_win32.cc',
'src/node_stdio_win32.cc',
# headers to make for a more pleasant IDE experience
'src/platform_win32.h',
],
@@ -169,7 +164,6 @@
'src/node_signal_watcher.cc',
'src/node_stat_watcher.cc',
'src/node_io_watcher.cc',
'src/node_stdio.cc',
]
}],
[ 'OS=="mac"', {
@@ -1236,7 +1236,8 @@ void DisplayExceptionLine (TryCatch &try_catch) {

Handle<Message> message = try_catch.Message();

node::Stdio::DisableRawMode(STDIN_FILENO);
uv_tty_reset_mode();

fprintf(stderr, "\n");

if (!message.IsEmpty()) {
@@ -1338,6 +1339,34 @@ Local<Value> ExecuteString(Handle<String> source, Handle<Value> filename) {
}


/* STDERR IS ALWAY SYNC ALWAYS UTF8 */
static Handle<Value> WriteError (const Arguments& args) {
HandleScope scope;

if (args.Length() < 1) {
return Undefined();
}

String::Utf8Value msg(args[0]->ToString());

ssize_t r;
size_t written = 0;
while (written < (size_t) msg.length()) {
r = write(STDERR_FILENO, (*msg) + written, msg.length() - written);
if (r < 0) {
if (errno == EAGAIN || errno == EIO) {
usleep(100);
continue;
}
return ThrowException(ErrnoException(errno, "write"));
}
written += (size_t)r;
}

return True();
}


static Handle<Value> Chdir(const Arguments& args) {
HandleScope scope;

@@ -2174,6 +2203,8 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
NODE_SET_METHOD(process, "chdir", Chdir);
NODE_SET_METHOD(process, "cwd", Cwd);

NODE_SET_METHOD(process, "writeError", WriteError);

NODE_SET_METHOD(process, "umask", Umask);

#ifdef __POSIX__
@@ -2198,7 +2229,6 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {


static void AtExit() {
node::Stdio::Flush();
uv_tty_reset_mode();
}

@@ -458,9 +458,6 @@
// backend.
function translateId(id) {
switch (id) {
case 'tty':
return process.features.uv ? 'tty_uv' : 'tty_legacy';

default:
return id;
}
@@ -31,7 +31,6 @@ NODE_EXT_LIST_ITEM(node_http_parser)
#ifdef __POSIX__
NODE_EXT_LIST_ITEM(node_signal_watcher)
#endif
NODE_EXT_LIST_ITEM(node_stdio)
NODE_EXT_LIST_ITEM(node_os)
NODE_EXT_LIST_ITEM(node_zlib)

@@ -899,13 +899,10 @@ def build(bld):
src/v8_typed_array.cc
"""

if sys.platform.startswith("win32"):
node.source += " src/node_stdio_win32.cc "
else:
if not sys.platform.startswith("win32"):
node.source += " src/node_signal_watcher.cc "
node.source += " src/node_stat_watcher.cc "
node.source += " src/node_io_watcher.cc "
node.source += " src/node_stdio.cc "

node.source += bld.env["PLATFORM_FILE"]
if not product_type_is_lib: