Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-01-02 08:54:46 +0300
committerRyan Dahl <ry@tinyclouds.org>2011-01-02 08:54:46 +0300
commit2e3e95ee89045966dbd6bf955c319ab448c1c85e (patch)
treee921ae2248f6f7245171f8332ce025c0ac626434 /src
parentc82fe30ca14c815aa4c5d6126dd39ba1f5ea7c6d (diff)
add process.stdin
Diffstat (limited to 'src')
-rw-r--r--src/node.js16
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;
};