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

Commit

Permalink
scope.Close in GuessHandleType; don't use uv_is_tty
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Sep 27, 2011
1 parent e1dc6e6 commit 2e389c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/node.js
Expand Up @@ -108,10 +108,10 @@


} else { } else {
var binding = process.binding('stdio'); var binding = process.binding('stdio');
var fd = binding.openStdin();
var Module = NativeModule.require('module'); var Module = NativeModule.require('module');


if (NativeModule.require('tty').isatty(fd)) { // If stdin is a TTY.
if (NativeModule.require('tty').isatty(0)) {
// REPL // REPL
Module.requireRepl().start(); Module.requireRepl().start();


Expand Down
8 changes: 3 additions & 5 deletions src/tty_wrap.cc
Expand Up @@ -69,20 +69,18 @@ class TTYWrap : StreamWrap {


switch (t) { switch (t) {
case UV_TTY: case UV_TTY:
return String::New("TTY"); return scope.Close(String::New("TTY"));


case UV_NAMED_PIPE: case UV_NAMED_PIPE:
return String::New("PIPE"); return scope.Close(String::New("PIPE"));


case UV_FILE: case UV_FILE:
return String::New("FILE"); return scope.Close(String::New("FILE"));


default: default:
assert(0); assert(0);
return v8::Undefined(); return v8::Undefined();
} }
return uv_is_tty(fd) ? v8::True() : v8::False();

} }


static Handle<Value> IsTTY(const Arguments& args) { static Handle<Value> IsTTY(const Arguments& args) {
Expand Down

0 comments on commit 2e389c6

Please sign in to comment.