aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-02-23 17:44:21 -0800
committerGravatar murgatroid99 <mlumish@google.com>2015-02-23 17:48:56 -0800
commit99885c98346c5052e636b3c3c2c035e1bfbf52fc (patch)
treefd6b0fdf977d65323d48b1608d839d25717e521c
parenta7552b9d4cfdb2a4a36dbe87cb83eeb863aa38d9 (diff)
Fixed old lint errors
-rw-r--r--src/node/examples/pubsub/pubsub_demo.js6
-rw-r--r--src/node/examples/route_guide_client.js6
-rw-r--r--src/node/examples/route_guide_server.js10
3 files changed, 17 insertions, 5 deletions
diff --git a/src/node/examples/pubsub/pubsub_demo.js b/src/node/examples/pubsub/pubsub_demo.js
index a9b6acbd7e..94d2002d86 100644
--- a/src/node/examples/pubsub/pubsub_demo.js
+++ b/src/node/examples/pubsub/pubsub_demo.js
@@ -27,6 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'use strict';
+
var async = require('async');
var fs = require('fs');
var GoogleAuth = require('googleauth');
@@ -270,7 +272,9 @@ function main(callback) {
if (require.main === module) {
main(function(err) {
- if (err) throw err;
+ if (err) {
+ throw err;
+ }
});
}
diff --git a/src/node/examples/route_guide_client.js b/src/node/examples/route_guide_client.js
index d4c083a6c5..425a94ee5e 100644
--- a/src/node/examples/route_guide_client.js
+++ b/src/node/examples/route_guide_client.js
@@ -27,6 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'use strict';
+
var async = require('async');
var fs = require('fs');
var parseArgs = require('minimist');
@@ -110,7 +112,9 @@ function runRecordRoute(callback) {
string: 'db_path'
});
fs.readFile(path.resolve(argv.db_path), function(err, data) {
- if (err) callback(err);
+ if (err) {
+ callback(err);
+ }
var feature_list = JSON.parse(data);
var num_points = 10;
diff --git a/src/node/examples/route_guide_server.js b/src/node/examples/route_guide_server.js
index 0d3b585150..8970dd6544 100644
--- a/src/node/examples/route_guide_server.js
+++ b/src/node/examples/route_guide_server.js
@@ -27,6 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'use strict';
+
var fs = require('fs');
var parseArgs = require('minimist');
var path = require('path');
@@ -163,7 +165,7 @@ function recordRoute(call, callback) {
}
/* For each point after the first, add the incremental distance from the
* previous point to the total distance value */
- if (previous != null) {
+ if (previous !== null) {
distance += getDistance(previous, point);
}
previous = point;
@@ -173,7 +175,7 @@ function recordRoute(call, callback) {
point_count: point_count,
feature_count: feature_count,
// Cast the distance to an integer
- distance: distance|0,
+ distance: Math.floor(distance),
// End the timer
elapsed_time: process.hrtime(start_time)[0]
});
@@ -240,7 +242,9 @@ if (require.main === module) {
string: 'db_path'
});
fs.readFile(path.resolve(argv.db_path), function(err, data) {
- if (err) throw err;
+ if (err) {
+ throw err;
+ }
feature_list = JSON.parse(data);
routeServer.listen();
});