From 8ad880f3fc987c1a5f2045b15bcb5d8963513a97 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 25 Jun 2019 14:53:58 -0700 Subject: [PATCH] net: replace _writableState.finished with writableFinished Replace usage of quasi-private _writableState.finished with public writableFinished property. PR-URL: https://github.com/nodejs/node/pull/27974 Refs: https://github.com/nodejs/node/issues/445 Reviewed-By: Anna Henningsen Reviewed-By: Benjamin Gruenbaum Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Matteo Collina Reviewed-By: Luigi Pinca --- lib/net.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index 6c2bf568758ed6..94b4e2a86cbed0 100644 --- a/lib/net.js +++ b/lib/net.js @@ -556,7 +556,7 @@ Socket.prototype.destroySoon = function() { if (this.writable) this.end(); - if (this._writableState.finished) + if (this.writableFinished) this.destroy(); else this.once('finish', this.destroy);