From b10154ff25146e116c34a351017509f42525c852 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 30 Jan 2013 09:48:42 +0100 Subject: [PATCH] fixed jslint --- js/client/client.js | 2 +- .../modules/org/arangodb/graph/traversal.js | 25 +++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/js/client/client.js b/js/client/client.js index 5b5802408f..d0d1989336 100755 --- a/js/client/client.js +++ b/js/client/client.js @@ -1,5 +1,5 @@ /*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */ -/*global require */ +/*global require, SYS_UNIT_TESTS */ //////////////////////////////////////////////////////////////////////////////// /// @brief ArangoShell client API diff --git a/js/common/modules/org/arangodb/graph/traversal.js b/js/common/modules/org/arangodb/graph/traversal.js index 80eb27ecc5..82006f6885 100644 --- a/js/common/modules/org/arangodb/graph/traversal.js +++ b/js/common/modules/org/arangodb/graph/traversal.js @@ -1,4 +1,4 @@ -/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */ +/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, continue: true */ /*global require, exports */ //////////////////////////////////////////////////////////////////////////////// @@ -33,6 +33,8 @@ var arangodb = require("org/arangodb"); var db = arangodb.db; +var ArangoTraverser; + // ----------------------------------------------------------------------------- // --SECTION-- public functions // ----------------------------------------------------------------------------- @@ -379,10 +381,12 @@ function trackingVisitor (config, result, vertex, path) { else if (obj instanceof Object) { copy = { }; - for (i in obj) { - if (obj.hasOwnProperty && obj.hasOwnProperty(i)) { - copy[i] = clone(obj[i]); - } + if (obj.hasOwnProperty) { + for (i in obj) { + if (obj.hasOwnProperty(i)) { + copy[i] = clone(obj[i]); + } + } } } @@ -564,9 +568,10 @@ function parseFilterResult (args) { function checkUniqueness (config, visited, vertex, edge) { var uniqueness = config.uniqueness; var datasource = config.datasource; + var id; if (uniqueness.vertices !== ArangoTraverser.UNIQUE_NONE) { - var id = datasource.getVertexId(vertex); + id = datasource.getVertexId(vertex); if (visited.vertices[id] === true) { return false; @@ -576,7 +581,7 @@ function checkUniqueness (config, visited, vertex, edge) { } if (edge !== null && uniqueness.edges !== ArangoTraverser.UNIQUE_NONE) { - var id = datasource.getEdgeId(edge); + id = datasource.getEdgeId(edge); if (visited.edges[id] === true) { return false; @@ -771,7 +776,7 @@ function depthFirstSearch () { visited.vertices = this.getPathItems(config.datasource.getVertexId, path.vertices); } if (config.uniqueness.edges === ArangoTraverser.UNIQUE_PATH) { - visited.edges = this.getPathItems(config.datasource,getEdgeId, path.edges); + visited.edges = this.getPathItems(config.datasource.getEdgeId, path.edges); } if (! checkUniqueness(config, visited, vertex, edge)) { @@ -851,7 +856,7 @@ function depthFirstSearch () { /// @brief traversal constructor //////////////////////////////////////////////////////////////////////////////// -function ArangoTraverser (config) { +ArangoTraverser = function (config) { var defaults = { order: ArangoTraverser.PRE_ORDER, itemOrder: ArangoTraverser.FORWARD, @@ -912,7 +917,7 @@ function ArangoTraverser (config) { } this.config = config; -} +}; //////////////////////////////////////////////////////////////////////////////// /// @}