Skip to content

fs: make `SyncWriteStream` inherit from `Writable`

Rodrigo Muino Tomonari requested to merge github/fork/addaleax/fs-sws into master
Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

fs, process?

Description of change

Make the internal SyncWriteStream a proper stream.Writable subclass. This allows for quite a bit of simplification, since SyncWriteStream predates the streams2/streams3 implementations.

Fixes: https://github.com/nodejs/node/issues/8828

I’ve tried to be conservative with the changes here, e.g. by keeping the explicit readable boolean property and by keeping the .destroy() behaviour of emitting an explicit close event, although I doubt that either of these are relied upon.

Merge request reports

Loading