Skip to content

StreamWriteable ending/ended states fix

Rodrigo Muino Tomonari requested to merge github/fork/aug2uag/stream_states into master

lib/_stream_duplex.js and lib/_stream_writable.js had mixed states for WritableState.ending and WriteableState.ended:

 Object.defineProperty(Duplex.prototype, 'writableEnded', {
   enumerable: false,
   get() {
    return this._writableState ? this._writableState.ending : false;
   }
 });

The Object.defineProperty methods were grouped, redundant comments removed and added to the group.

The writeableLength in _stream_writeable.js was unsafe return this._writableState.length; and that was also corrected to match its counterpart in _stream_duplex.js.

The APIs are identical across these two files and maybe should file an issue to have them as their own module.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading