diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-01-02 08:54:46 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-01-02 08:54:46 +0300 |
commit | 2e3e95ee89045966dbd6bf955c319ab448c1c85e (patch) | |
tree | e921ae2248f6f7245171f8332ce025c0ac626434 /src | |
parent | c82fe30ca14c815aa4c5d6126dd39ba1f5ea7c6d (diff) |
add process.stdin
Diffstat (limited to 'src')
-rw-r--r-- | src/node.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/node.js b/src/node.js index 5bc5e46357e..1f910a2a3be 100644 --- a/src/node.js +++ b/src/node.js @@ -464,7 +464,9 @@ }; - var stdout; + var stdout, stdin; + + process.__defineGetter__('stdout', function() { if (stdout) return stdout; @@ -487,8 +489,8 @@ return stdout; }); - var stdin; - process.openStdin = function() { + + process.__defineGetter__('stdin', function() { if (stdin) return stdin; var binding = process.binding('stdio'), @@ -503,9 +505,13 @@ stdin.readable = true; } - stdin.resume(); - return stdin; + }); + + + process.openStdin = function() { + process.stdin.resume(); + return process.stdin; }; |