mirror of https://github.com/grpc/grpc-node.git
Removed all instances of == in js files
This commit is contained in:
parent
1e71e716dc
commit
b62fdb2f0b
|
@ -52,7 +52,8 @@ var Server = grpc.buildServer([math.Math.service]);
|
|||
*/
|
||||
function mathDiv(call, cb) {
|
||||
var req = call.request;
|
||||
if (req.divisor == 0) {
|
||||
// Unary + is explicit coersion to integer
|
||||
if (+req.divisor === 0) {
|
||||
cb(new Error('cannot divide by zero'));
|
||||
}
|
||||
cb(null, {
|
||||
|
@ -89,7 +90,7 @@ function mathSum(call, cb) {
|
|||
// Here, call is a standard readable Node object Stream
|
||||
var sum = 0;
|
||||
call.on('data', function(data) {
|
||||
sum += data.num | 0;
|
||||
sum += (+data.num);
|
||||
});
|
||||
call.on('end', function() {
|
||||
cb(null, {num: sum});
|
||||
|
@ -104,7 +105,7 @@ function mathDivMany(stream) {
|
|||
Transform.call(this, options);
|
||||
}
|
||||
DivTransform.prototype._transform = function(div_args, encoding, callback) {
|
||||
if (div_args.divisor == 0) {
|
||||
if (+div_args.divisor === 0) {
|
||||
callback(new Error('cannot divide by zero'));
|
||||
}
|
||||
callback(null, {
|
||||
|
|
|
@ -183,7 +183,7 @@ function pingPong(client, done) {
|
|||
assert.equal(response.payload.body.limit - response.payload.body.offset,
|
||||
response_sizes[index]);
|
||||
index += 1;
|
||||
if (index == 4) {
|
||||
if (index === 4) {
|
||||
call.end();
|
||||
} else {
|
||||
call.write({
|
||||
|
|
Loading…
Reference in New Issue