From 5cb1fd2e3239356cbddc833fb4c8b8817c49c5f8 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 15 Sep 2011 13:35:24 -0700 Subject: [PATCH] net.Socket(fd) should start readable and writable --- lib/net_uv.js | 1 + test/simple/test-console.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/net_uv.js b/lib/net_uv.js index dddc03fcb0..b53b3ba89d 100644 --- a/lib/net_uv.js +++ b/lib/net_uv.js @@ -89,6 +89,7 @@ function Socket(options) { // console.trace(); this._handle = createPipe(); this._handle.open(fd); + this.readable = this.writable = true; initSocketHandle(this); } else { // private diff --git a/test/simple/test-console.js b/test/simple/test-console.js index 4ec37292fc..39d11d16e7 100644 --- a/test/simple/test-console.js +++ b/test/simple/test-console.js @@ -25,6 +25,10 @@ var common = require('../common'); var assert = require('assert'); +assert.ok(process.stdout.writable); +assert.ok(process.stderr.writable); + + var stdout_write = global.process.stdout.write; var strings = []; global.process.stdout.write = function(string) {