Skip to content

Commit

Permalink
Replaced some equality checks with strict equality checks
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Feb 28, 2015
1 parent 1dea979 commit 0962067
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/js/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

/**
Expand Down Expand Up @@ -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);
});
Expand All @@ -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);
});
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 0962067

Please sign in to comment.