Changes as requested + JavaScript Style Guide rules

- Apply rule [#16.1](https://github.com/meteor/javascript#16.1) to
if/else blocks
This commit is contained in:
dr-dimitru
2017-01-17 14:02:12 +03:00
parent 5b193e53b4
commit ebde43db67

View File

@@ -490,12 +490,13 @@ Tinytest.addAsync("mongo-livedata - fuzz test, " + idGeneration, function(test,
} else if (op === 1 || op === 2) {
var val;
x = correct[which];
if (op === 1)
if (op === 1) {
// Small change, not likely to cause a move
val = x + (rnd(2) ? -1 : 1);
else
} else {
// Large change, likely to cause a move
val = rnd(1000000);
}
coll.update({run: run, x: x}, {$set: {x: val}});
correct[which] = val;
max_counters.change++;
@@ -1191,10 +1192,11 @@ if (Meteor.isServer) {
test.isTrue(setsEqual(ids, bufferIds), "expected: " + ids + "; got: " + bufferIds);
};
var testSafeAppendToBufferFlag = function (expected) {
if (expected)
if (expected) {
test.isTrue(o.handle._multiplexer._observeDriver._safeAppendToBuffer);
else
} else {
test.isFalse(o.handle._multiplexer._observeDriver._safeAppendToBuffer);
}
};
var ids = {};
@@ -3001,7 +3003,9 @@ _.extend(TestCustomType.prototype, {
return new TestCustomType(this.myHead, this.myTail);
},
equals: function (other) {
return other instanceof TestCustomType && EJSON.equals(this.myHead, other.myHead) && EJSON.equals(this.myTail, other.myTail);
return other instanceof TestCustomType
&& EJSON.equals(this.myHead, other.myHead)
&& EJSON.equals(this.myTail, other.myTail);
},
typeName: function () {
return 'someCustomType';