Skip to content

fs: guarantee order of callbacks in ws.close

Rodrigo Muino Tomonari requested to merge github/fork/mcollina/fix-17951 into master

Refactor WriteStream.prototype.close and WriteStream.prototype._destroy to always call the callback passed to close in order. Protects from calling .close() without a callback.

Fixes: https://github.com/nodejs/node/issues/17951 See: https://github.com/nodejs/node/pull/15407

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

fs

Merge request reports

Loading