When a Duplex is not Writable

7 views
Skip to first unread message

Matthew Phillips

unread,
Aug 28, 2015, 10:42:41 PM8/28/15
to nod...@googlegroups.com
I'm trying to debug a weird issue where I'm creating Transform streams
(using through2) and at some point the Writable inheritance breaks
because `this` is no longer an instanceof Duplex:
https://github.com/nodejs/readable-stream/blob/ca99c199f54466432c564f5faee12e7898de7eeb/lib/_stream_writable.js#L165

This issue only occurs on Windows. I believe the constructor is being
called in the Duplex constructor here:
https://github.com/nodejs/readable-stream/blob/b6810590821e2082d5b79e3e0d08d3d090ebc353/lib/_stream_duplex.js#L47

This seems impossible to me unless there is a v8 bug. As a sanity check
I thought I'd ask here if what could possibly cause this problem.

I tried to reproduce in a test by creating 1000 Transform streams but it
never breaks down in that scenario. My first thought was that there is a
circular dependency bug causing there to be 2 Duplex modules but I set a
global and confirmed that they are the same, so I'm at a bit of a loss
here. Any ideas?
Reply all
Reply to author
Forward
0 new messages