From faad2aedb8955d747cb9cc48897eb4d39116b81e Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Sun, 14 Apr 2019 09:52:00 +0000
Subject: [PATCH] Use === comparisons in XHR error handlers

---
 index.js |    4 ++--
 map.js   |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/index.js b/index.js
index 3a07ed9..fd60868 100644
--- a/index.js
+++ b/index.js
@@ -54,9 +54,9 @@
 
 function fail_ajax(data) {
 	// abort() is not a failure
-	if(data.readyState == 0 && data.statusText == 'abort') return;
+	if(data.readyState === 0) return;
 	
-	if(data.status == 0) {
+	if(data.status === 0) {
 		fail(lang.error_request_failed_connectivity, data);
 	} else if (data.statusText) {
 		fail(lang.error_request_failed_status.replace('$status', data.statusText), data);
diff --git a/map.js b/map.js
index c34431e..aefb371 100644
--- a/map.js
+++ b/map.js
@@ -151,9 +151,9 @@
 
 function fail_ajax_generic(data, fnc) {
 	// abort() is not a failure
-	if(data.readyState == 0) return;
+	if(data.readyState === 0) return;
 	
-	if(data.status == 0) {
+	if(data.status === 0) {
 		fnc(lang.error_request_failed_connectivity, data);
 	} else if (data.statusText) {
 		fnc(lang.error_request_failed_status.replace('$status', data.statusText), data);

--
Gitblit v1.9.1