Closed
Description
E.g., an XHR stream to a file system stream, xhrStream.pipeTo(fsStream)
.
As-is, there might be a problem if e.g. the user does
var oldWrite = fsStream.write;
fsStream.write = function (chunk) {
console.log("AOP logging!!", chunk);
oldWrite.apply(this, arguments);
};
after the pipe is already set up. The implementation would have to detect this and start routing data to the main thread, which kind of sucks.
A possible fix would be caching the value of dest.write
at the top of pipeTo
.
/cc @sicking