Browse Source

scope.Close in GuessHandleType; don't use uv_is_tty

v0.7.4-release
Ryan Dahl 13 years ago
parent
commit
2e389c6531
  1. 4
      src/node.js
  2. 8
      src/tty_wrap.cc

4
src/node.js

@ -108,10 +108,10 @@
} else {
var binding = process.binding('stdio');
var fd = binding.openStdin();
var Module = NativeModule.require('module');
if (NativeModule.require('tty').isatty(fd)) {
// If stdin is a TTY.
if (NativeModule.require('tty').isatty(0)) {
// REPL
Module.requireRepl().start();

8
src/tty_wrap.cc

@ -69,20 +69,18 @@ class TTYWrap : StreamWrap {
switch (t) {
case UV_TTY:
return String::New("TTY");
return scope.Close(String::New("TTY"));
case UV_NAMED_PIPE:
return String::New("PIPE");
return scope.Close(String::New("PIPE"));
case UV_FILE:
return String::New("FILE");
return scope.Close(String::New("FILE"));
default:
assert(0);
return v8::Undefined();
}
return uv_is_tty(fd) ? v8::True() : v8::False();
}
static Handle<Value> IsTTY(const Arguments& args) {

Loading…
Cancel
Save