summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormynane <755836844@qq.com>2021-09-30 02:55:10 +0800
committerGitHub <noreply@github.com>2021-09-29 11:55:10 -0700
commit62920e4ef5bed131c125c4b8b5bdb8250584946f (patch)
tree5766e53b53bf70544c5b4b7a73ac3f4187c33e7b
parent4cf744032dd8a4090cf09935c9f5f6767f943078 (diff)
fix(ext/http): merge identical if/else branches (#12269)
-rw-r--r--ext/http/01_http.js8
1 files changed, 3 insertions, 5 deletions
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;