|
|
@ -50,9 +50,17 @@ function Parser(stream, debug) {
|
|
|
|
inherits(Parser, EventEmitter);
|
|
|
|
inherits(Parser, EventEmitter);
|
|
|
|
|
|
|
|
|
|
|
|
Parser.prototype.setStream = function(stream) {
|
|
|
|
Parser.prototype.setStream = function(stream) {
|
|
|
|
if (/^v0\.8\./.test(process.version))
|
|
|
|
if (/^v0\.8\./.test(process.version)) {
|
|
|
|
stream = new ReadableStream().wrap(stream);
|
|
|
|
var newStream = new ReadableStream(),
|
|
|
|
|
|
|
|
wrapped = newStream.wrap(stream);
|
|
|
|
|
|
|
|
// as of now, 07/02/2013, the readable-stream module is behind in updates
|
|
|
|
|
|
|
|
// and has different behavior for the return value of wrap() compared to
|
|
|
|
|
|
|
|
// node v0.10+, so we check for that here ...
|
|
|
|
|
|
|
|
if (wrapped)
|
|
|
|
|
|
|
|
stream = wrapped;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
stream = newStream;
|
|
|
|
|
|
|
|
}
|
|
|
|
this._stream = stream;
|
|
|
|
this._stream = stream;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|