DRY binding('stdio')
authorHerbert Vojčík <herby@mailbox.sk>
Wed, 28 Apr 2010 23:07:13 +0000 (01:07 +0200)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 28 Apr 2010 23:08:36 +0000 (16:08 -0700)
src/node.js

index 216f50d..4a6ed96 100644 (file)
@@ -141,11 +141,12 @@ var stdin;
 process.openStdin = function () {
   if (stdin) return stdin;
 
-  var net = module.requireNative('net'),
+var binding = process.binding('stdio'),
+    net = module.requireNative('net'),
     fs = module.requireNative('fs'),
-    fd = process.binding('stdio').openStdin();
+    fd = binding.openStdin();
 
-  if (process.binding('stdio').isStdinBlocking()) {
+  if (binding.isStdinBlocking()) {
     stdin = new net.Stream(fd);
     stdin.readable = true;
   } else {