[gnome-maps] Cleanup: Remove type coercion compares
- From: Mattias Bengtsson <mattiasb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] Cleanup: Remove type coercion compares
- Date: Thu, 16 Oct 2014 05:30:27 +0000 (UTC)
commit f343b9b2bb99e48a40b5bc7b5910722a2c2206bc
Author: Mattias Bengtsson <mattias jc bengtsson gmail com>
Date: Mon Oct 13 19:26:30 2014 +0200
Cleanup: Remove type coercion compares
The '==' and '!=' operators in JS is a bit weird since it tries to do
automatic and sometimes unexpected type coercions instead of a strict
comparison.
In Maps we have decided to use the '===' and '!==' operators instead
since they do stricter checks.
This patch converts two cases where '!=' passed through review.
https://bugzilla.gnome.org/show_bug.cgi?id=699967
src/mapMarker.js | 2 +-
src/utils.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/mapMarker.js b/src/mapMarker.js
index ba93f8e..bef3ace 100644
--- a/src/mapMarker.js
+++ b/src/mapMarker.js
@@ -176,7 +176,7 @@ const MapMarker = new Lang.Class({
this._mapView.onSetMarkerSelected(this);
let markerSelectedSignalId = this._mapView.connect('marker-selected', (function(mapView,
selectedMarker) {
- if (this.get_parent() != selectedMarker.get_parent())
+ if (this.get_parent() !== selectedMarker.get_parent())
this.selected = false;
}).bind(this));
diff --git a/src/utils.js b/src/utils.js
index d6ce833..f5b9f0d 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -237,7 +237,7 @@ function _load_http_icon(icon, loadCompleteCallback) {
let soup_session = _get_soup_session();
soup_session.queue_message(msg, function(session, msg) {
- if (msg.status_code != Soup.KnownStatusCode.OK) {
+ if (msg.status_code !== Soup.KnownStatusCode.OK) {
log("Failed to load pixbuf: " + msg.reason_phrase);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]