Permalink
Browse files

scope.Close in GuessHandleType; don't use uv_is_tty

  • Loading branch information...
1 parent e1dc6e6 commit 2e389c6531022ea571e1563f18a3ced7abf1a748 @ry ry committed Sep 23, 2011
Showing with 5 additions and 7 deletions.
  1. +2 −2 src/node.js
  2. +3 −5 src/tty_wrap.cc
View
@@ -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();
View
@@ -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) {

0 comments on commit 2e389c6

Please sign in to comment.