Only print readyState deprication message once
This commit is contained in:
Родитель
836e6a3fcb
Коммит
b94af8d6b1
|
@ -384,9 +384,13 @@ exports.createConnection = function (port, host) {
|
|||
};
|
||||
|
||||
|
||||
var readyStateMessage;
|
||||
Object.defineProperty(Socket.prototype, 'readyState', {
|
||||
get: function () {
|
||||
sys.error('readyState is depricated. Use stream.readable or stream.writable');
|
||||
if (!readyStateMessage) {
|
||||
readyStateMessage = 'readyState is depricated. Use stream.readable or stream.writable';
|
||||
sys.error(readyStateMessage);
|
||||
}
|
||||
if (this.readable && this.writable) {
|
||||
return 'open';
|
||||
} else if (this.readable && !this.writable){
|
||||
|
|
Загрузка…
Ссылка в новой задаче