|
@ -27,7 +27,7 @@ const TTY = process.binding('tty_wrap').TTY; |
|
|
const isTTY = process.binding('tty_wrap').isTTY; |
|
|
const isTTY = process.binding('tty_wrap').isTTY; |
|
|
const inherits = util.inherits; |
|
|
const inherits = util.inherits; |
|
|
const errnoException = util._errnoException; |
|
|
const errnoException = util._errnoException; |
|
|
|
|
|
const errors = require('internal/errors'); |
|
|
|
|
|
|
|
|
exports.isatty = function(fd) { |
|
|
exports.isatty = function(fd) { |
|
|
return isTTY(fd); |
|
|
return isTTY(fd); |
|
@ -38,7 +38,7 @@ function ReadStream(fd, options) { |
|
|
if (!(this instanceof ReadStream)) |
|
|
if (!(this instanceof ReadStream)) |
|
|
return new ReadStream(fd, options); |
|
|
return new ReadStream(fd, options); |
|
|
if (fd >> 0 !== fd || fd < 0) |
|
|
if (fd >> 0 !== fd || fd < 0) |
|
|
throw new RangeError('fd must be positive integer: ' + fd); |
|
|
throw new errors.RangeError('ERR_INVALID_FD', fd); |
|
|
|
|
|
|
|
|
options = util._extend({ |
|
|
options = util._extend({ |
|
|
highWaterMark: 0, |
|
|
highWaterMark: 0, |
|
@ -67,7 +67,7 @@ function WriteStream(fd) { |
|
|
if (!(this instanceof WriteStream)) |
|
|
if (!(this instanceof WriteStream)) |
|
|
return new WriteStream(fd); |
|
|
return new WriteStream(fd); |
|
|
if (fd >> 0 !== fd || fd < 0) |
|
|
if (fd >> 0 !== fd || fd < 0) |
|
|
throw new RangeError('fd must be positive integer: ' + fd); |
|
|
throw new errors.RangeError('ERR_INVALID_FD', fd); |
|
|
|
|
|
|
|
|
net.Socket.call(this, { |
|
|
net.Socket.call(this, { |
|
|
handle: new TTY(fd, false), |
|
|
handle: new TTY(fd, false), |
|
|