From 0962067ca99d7dcb3f54f166e07af1350785475c Mon Sep 17 00:00:00 2001 From: jos Date: Sat, 28 Feb 2015 15:36:56 +0100 Subject: [PATCH] Replaced some equality checks with strict equality checks --- src/js/Node.js | 14 +++++++------- src/js/util.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/js/Node.js b/src/js/Node.js index 370d11f..7588390 100644 --- a/src/js/Node.js +++ b/src/js/Node.js @@ -94,7 +94,7 @@ Node.prototype.setParent = function(parent) { */ Node.prototype.setField = function(field, fieldEditable) { this.field = field; - this.fieldEditable = (fieldEditable == true); + this.fieldEditable = (fieldEditable === true); }; /** @@ -282,7 +282,7 @@ Node.prototype.expand = function(recurse) { this.showChilds(); - if (recurse != false) { + if (recurse !== false) { this.childs.forEach(function (child) { child.expand(recurse); }); @@ -302,7 +302,7 @@ Node.prototype.collapse = function(recurse) { this.hideChilds(); // collapse childs in case of recurse - if (recurse != false) { + if (recurse !== false) { this.childs.forEach(function (child) { child.collapse(recurse); }); @@ -1006,7 +1006,7 @@ Node.prototype._getDomValue = function(silent) { catch (err) { this.value = undefined; // TODO: sent an action with the new, invalid value? - if (silent != true) { + if (silent !== true) { throw err; } } @@ -1171,7 +1171,7 @@ Node.prototype._getDomField = function(silent) { catch (err) { this.field = undefined; // TODO: sent an action here, with the new, invalid value? - if (silent != true) { + if (silent !== true) { throw err; } } @@ -1588,12 +1588,12 @@ Node.prototype.updateDom = function (options) { this._updateDomValue(); // update childs indexes - if (options && options.updateIndexes == true) { + if (options && options.updateIndexes === true) { // updateIndexes is true or undefined this._updateDomIndexes(); } - if (options && options.recurse == true) { + if (options && options.recurse === true) { // recurse is true or undefined. update childs recursively if (this.childs) { this.childs.forEach(function (child) { diff --git a/src/js/util.js b/src/js/util.js index 10ae416..5b909d5 100644 --- a/src/js/util.js +++ b/src/js/util.js @@ -258,7 +258,7 @@ exports.stripFormatting = function stripFormatting(divElement) { if (attributes) { for (var j = attributes.length - 1; j >= 0; j--) { var attribute = attributes[j]; - if (attribute.specified == true) { + if (attribute.specified === true) { child.removeAttribute(attribute.name); } }