Removed all instances of == in js files

pull/207/head
murgatroid99 10 years ago
parent ba1be37ffd
commit 7eb6bb99d2
  1. 7
      src/node/examples/math_server.js
  2. 2
      src/node/interop/interop_client.js
  3. 2
      src/node/server.js

@ -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({

@ -233,7 +233,7 @@ function Server(options) {
function handleNewCall(event) {
var call = event.call;
var data = event.data;
if (data == null) {
if (data === null) {
return;
}
server.requestCall(handleNewCall);

Loading…
Cancel
Save