_debug_agent: use `readableObjectMode` option
authorVladimir Kurchatkin <vladimir.kurchatkin@gmail.com>
Fri, 9 Jan 2015 11:51:39 +0000 (14:51 +0300)
committerChris Dickinson <christopher.s.dickinson@gmail.com>
Thu, 15 Jan 2015 19:10:48 +0000 (11:10 -0800)
Use public `readableObjectMode` option to construct `Transform`
instead of accessing private `_readableState.objectMode`.

Partially addresses https://github.com/iojs/io.js/issues/445.

PR-URL: https://github.com/iojs/io.js/pull/270
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
lib/_debug_agent.js

index d0e6dff..221b672 100644 (file)
@@ -83,8 +83,9 @@ Agent.prototype.notifyWait = function notifyWait() {
 };
 
 function Client(agent, socket) {
-  Transform.call(this);
-  this._readableState.objectMode = true;
+  Transform.call(this, {
+    readableObjectMode: true
+  });
 
   this.agent = agent;
   this.binding = this.agent.binding;