From 62920e4ef5bed131c125c4b8b5bdb8250584946f Mon Sep 17 00:00:00 2001 From: mynane <755836844@qq.com> Date: Thu, 30 Sep 2021 02:55:10 +0800 Subject: fix(ext/http): merge identical if/else branches (#12269) --- ext/http/01_http.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'ext') diff --git a/ext/http/01_http.js b/ext/http/01_http.js index 2681edff8..8c4f08aab 100644 --- a/ext/http/01_http.js +++ b/ext/http/01_http.js @@ -70,11 +70,9 @@ // a generic `BadResource` error. Instead store this error and replace // those with it. this[connErrorSymbol] = error; - if (error instanceof BadResource) { - return null; - } else if (error instanceof Interrupted) { - return null; - } else if ( + if ( + error instanceof BadResource || + error instanceof Interrupted || StringPrototypeIncludes(error.message, "connection closed") ) { return null; -- cgit v1.2.3