From 1ea18bf44e90a083ad3c8391bc2050d9e1a8be81 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 23 Jan 2015 15:15:46 -0800 Subject: [PATCH] Moved some code around for clarity --- surface_client.js | 28 ++++++++++++++-------------- surface_server.js | 27 ++++++++++++++------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/surface_client.js b/surface_client.js index abec999c..aba8feea 100644 --- a/surface_client.js +++ b/surface_client.js @@ -79,6 +79,20 @@ function ClientReadableObjectStream(stream) { this._stream.pause(); } +/** + * _read implementation for both types of streams that allow reading. + * @this {ClientReadableObjectStream} + * @param {number} size Ignored + */ +function _read(size) { + this._stream.resume(); +} + +/** + * See docs for _read + */ +ClientReadableObjectStream.prototype._read = _read; + util.inherits(ClientWritableObjectStream, Writable); /** @@ -98,20 +112,6 @@ function ClientWritableObjectStream(stream) { }); } -/** - * _read implementation for both types of streams that allow reading. - * @this {ClientReadableObjectStream} - * @param {number} size Ignored - */ -function _read(size) { - this._stream.resume(); -} - -/** - * See docs for _read - */ -ClientReadableObjectStream.prototype._read = _read; - /** * _write implementation for both types of streams that allow writing * @this {ClientWritableObjectStream} diff --git a/surface_server.js b/surface_server.js index e3c48b13..07c5339f 100644 --- a/surface_server.js +++ b/surface_server.js @@ -74,6 +74,20 @@ function ServerReadableObjectStream(stream) { this._stream.pause(); } +/** + * _read implementation for both types of streams that allow reading. + * @this {ServerReadableObjectStream|ServerBidiObjectStream} + * @param {number} size Ignored + */ +function _read(size) { + this._stream.resume(); +} + +/** + * See docs for _read + */ +ServerReadableObjectStream.prototype._read = _read; + util.inherits(ServerWritableObjectStream, Writable); /** @@ -90,19 +104,6 @@ function ServerWritableObjectStream(stream) { this._stream.end(); }); } -/** - * _read implementation for both types of streams that allow reading. - * @this {ServerReadableObjectStream|ServerBidiObjectStream} - * @param {number} size Ignored - */ -function _read(size) { - this._stream.resume(); -} - -/** - * See docs for _read - */ -ServerReadableObjectStream.prototype._read = _read; /** * _write implementation for both types of streams that allow writing