tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jorg...@apache.org
Subject [38/44] tinkerpop git commit: Use ES6 syntax
Date Fri, 19 Jan 2018 08:31:12 GMT
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d458f76d/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
index f6a0de1..6dcd8f6 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js
@@ -22,1141 +22,1144 @@
  */
 'use strict';
 
-var t = require('./traversal.js');
-var remote = require('../driver/remote-connection');
-var utils = require('../utils');
-var Bytecode = require('./bytecode');
-var TraversalStrategies = require('./traversal-strategy').TraversalStrategies;
-var inherits = utils.inherits;
-var parseArgs = utils.parseArgs;
-
-/**
- *
- * @param {Graph} graph
- * @param {TraversalStrategies} traversalStrategies
- * @param {Bytecode} [bytecode]
- * @constructor
- */
-function GraphTraversalSource(graph, traversalStrategies, bytecode) {
-  this.graph = graph;
-  this.traversalStrategies = traversalStrategies;
-  this.bytecode = bytecode || new Bytecode();
+const Traversal = require('./traversal').Traversal;
+const remote = require('../driver/remote-connection');
+const utils = require('../utils');
+const Bytecode = require('./bytecode');
+const TraversalStrategies = require('./traversal-strategy').TraversalStrategies;
+const parseArgs = utils.parseArgs;
+
+
+/**
+ * Represents the primary DSL of the Gremlin traversal machine.
+ */
+class GraphTraversalSource {
+  /**
+   * @param {Graph} graph
+   * @param {TraversalStrategies} traversalStrategies
+   * @param {Bytecode} [bytecode]
+   */
+  constructor(graph, traversalStrategies, bytecode) {
+    this.graph = graph;
+    this.traversalStrategies = traversalStrategies;
+    this.bytecode = bytecode || new Bytecode();
+  }
+
+  /**
+   * @param remoteConnection
+   * @returns {GraphTraversalSource}
+   */
+  withRemote(remoteConnection) {
+    const traversalStrategy = new TraversalStrategies(this.traversalStrategies);
+    traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
+    return new GraphTraversalSource(this.graph, traversalStrategy, new Bytecode(this.bytecode));
+  }
+
+  /**
+   * Returns the string representation of the GraphTraversalSource.
+   * @returns {string}
+   */
+  toString() {
+    return 'graphtraversalsource[' + this.graph.toString() + ']';
+  }
+  
+  /**
+   * Graph Traversal Source withBulk method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  withBulk(args) {
+    const b = new Bytecode(this.bytecode).addSource('withBulk', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+  }
+  
+  /**
+   * Graph Traversal Source withPath method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  withPath(args) {
+    const b = new Bytecode(this.bytecode).addSource('withPath', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+  }
+  
+  /**
+   * Graph Traversal Source withSack method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  withSack(args) {
+    const b = new Bytecode(this.bytecode).addSource('withSack', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+  }
+  
+  /**
+   * Graph Traversal Source withSideEffect method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  withSideEffect(args) {
+    const b = new Bytecode(this.bytecode).addSource('withSideEffect', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+  }
+  
+  /**
+   * Graph Traversal Source withStrategies method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  withStrategies(args) {
+    const b = new Bytecode(this.bytecode).addSource('withStrategies', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+  }
+  
+  /**
+   * Graph Traversal Source withoutStrategies method.
+   * @param {...Object} args
+   * @returns {GraphTraversalSource}
+   */
+  withoutStrategies(args) {
+    const b = new Bytecode(this.bytecode).addSource('withoutStrategies', parseArgs.apply(null, arguments));
+    return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+  }
+  
+  /**
+   * E GraphTraversalSource step method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  E(args) {
+    const b = new Bytecode(this.bytecode).addStep('E', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+  }
+  
+  /**
+   * V GraphTraversalSource step method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  V(args) {
+    const b = new Bytecode(this.bytecode).addStep('V', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+  }
+  
+  /**
+   * addV GraphTraversalSource step method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  addV(args) {
+    const b = new Bytecode(this.bytecode).addStep('addV', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+  }
+  
+  /**
+   * inject GraphTraversalSource step method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  inject(args) {
+    const b = new Bytecode(this.bytecode).addStep('inject', parseArgs.apply(null, arguments));
+    return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+  }
+  
 }
 
 /**
- * @param remoteConnection
- * @returns {GraphTraversalSource}
- */
-GraphTraversalSource.prototype.withRemote = function (remoteConnection) {
-  var traversalStrategy = new TraversalStrategies(this.traversalStrategies);
-  traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
-  return new GraphTraversalSource(this.graph, traversalStrategy, new Bytecode(this.bytecode));
-};
-
-/**
- * Returns the string representation of the GraphTraversalSource.
- * @returns {string}
- */
-GraphTraversalSource.prototype.toString = function () {
-  return 'graphtraversalsource[' + this.graph.toString() + ']';
-};
-
-/**
- * Graph Traversal Source withBulk method.
- * @param {...Object} args
- * @returns {GraphTraversalSource}
- */
-GraphTraversalSource.prototype.withBulk = function (args) {
-  var b = new Bytecode(this.bytecode).addSource('withBulk', parseArgs.apply(null, arguments));
-  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
-};
-
-/**
- * Graph Traversal Source withPath method.
- * @param {...Object} args
- * @returns {GraphTraversalSource}
- */
-GraphTraversalSource.prototype.withPath = function (args) {
-  var b = new Bytecode(this.bytecode).addSource('withPath', parseArgs.apply(null, arguments));
-  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
-};
-
-/**
- * Graph Traversal Source withSack method.
- * @param {...Object} args
- * @returns {GraphTraversalSource}
- */
-GraphTraversalSource.prototype.withSack = function (args) {
-  var b = new Bytecode(this.bytecode).addSource('withSack', parseArgs.apply(null, arguments));
-  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
-};
-
-/**
- * Graph Traversal Source withSideEffect method.
- * @param {...Object} args
- * @returns {GraphTraversalSource}
- */
-GraphTraversalSource.prototype.withSideEffect = function (args) {
-  var b = new Bytecode(this.bytecode).addSource('withSideEffect', parseArgs.apply(null, arguments));
-  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
-};
-
-/**
- * Graph Traversal Source withStrategies method.
- * @param {...Object} args
- * @returns {GraphTraversalSource}
- */
-GraphTraversalSource.prototype.withStrategies = function (args) {
-  var b = new Bytecode(this.bytecode).addSource('withStrategies', parseArgs.apply(null, arguments));
-  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
-};
-
-/**
- * Graph Traversal Source withoutStrategies method.
- * @param {...Object} args
- * @returns {GraphTraversalSource}
- */
-GraphTraversalSource.prototype.withoutStrategies = function (args) {
-  var b = new Bytecode(this.bytecode).addSource('withoutStrategies', parseArgs.apply(null, arguments));
-  return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
-};
-
-/**
- * E GraphTraversalSource step method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversalSource.prototype.E = function (args) {
-  var b = new Bytecode(this.bytecode).addStep('E', parseArgs.apply(null, arguments));
-  return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
-};
-
-/**
- * V GraphTraversalSource step method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversalSource.prototype.V = function (args) {
-  var b = new Bytecode(this.bytecode).addStep('V', parseArgs.apply(null, arguments));
-  return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
-};
-
-/**
- * addV GraphTraversalSource step method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversalSource.prototype.addV = function (args) {
-  var b = new Bytecode(this.bytecode).addStep('addV', parseArgs.apply(null, arguments));
-  return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
-};
-
-/**
- * inject GraphTraversalSource step method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversalSource.prototype.inject = function (args) {
-  var b = new Bytecode(this.bytecode).addStep('inject', parseArgs.apply(null, arguments));
-  return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
-};
-
-/**
  * Represents a graph traversal.
- * @extends Traversal
- * @constructor
  */
-function GraphTraversal(graph, traversalStrategies, bytecode) {
-  t.Traversal.call(this, graph, traversalStrategies, bytecode);
+class GraphTraversal extends Traversal {
+  constructor(graph, traversalStrategies, bytecode) {
+    super(graph, traversalStrategies, bytecode);
+  }
+  
+  /**
+   * Graph traversal V method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  V(args) {
+    this.bytecode.addStep('V', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal addE method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  addE(args) {
+    this.bytecode.addStep('addE', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal addInE method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  addInE(args) {
+    this.bytecode.addStep('addInE', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal addOutE method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  addOutE(args) {
+    this.bytecode.addStep('addOutE', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal addV method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  addV(args) {
+    this.bytecode.addStep('addV', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal aggregate method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  aggregate(args) {
+    this.bytecode.addStep('aggregate', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal and method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  and(args) {
+    this.bytecode.addStep('and', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal as method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  as(args) {
+    this.bytecode.addStep('as', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal barrier method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  barrier(args) {
+    this.bytecode.addStep('barrier', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal both method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  both(args) {
+    this.bytecode.addStep('both', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal bothE method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  bothE(args) {
+    this.bytecode.addStep('bothE', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal bothV method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  bothV(args) {
+    this.bytecode.addStep('bothV', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal branch method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  branch(args) {
+    this.bytecode.addStep('branch', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal by method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  by(args) {
+    this.bytecode.addStep('by', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal cap method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  cap(args) {
+    this.bytecode.addStep('cap', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal choose method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  choose(args) {
+    this.bytecode.addStep('choose', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal coalesce method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  coalesce(args) {
+    this.bytecode.addStep('coalesce', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal coin method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  coin(args) {
+    this.bytecode.addStep('coin', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal constant method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  constant(args) {
+    this.bytecode.addStep('constant', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal count method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  count(args) {
+    this.bytecode.addStep('count', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal cyclicPath method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  cyclicPath(args) {
+    this.bytecode.addStep('cyclicPath', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal dedup method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  dedup(args) {
+    this.bytecode.addStep('dedup', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal drop method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  drop(args) {
+    this.bytecode.addStep('drop', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal emit method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  emit(args) {
+    this.bytecode.addStep('emit', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal filter method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  filter(args) {
+    this.bytecode.addStep('filter', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal flatMap method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  flatMap(args) {
+    this.bytecode.addStep('flatMap', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal fold method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  fold(args) {
+    this.bytecode.addStep('fold', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal from method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  from_(args) {
+    this.bytecode.addStep('from', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal group method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  group(args) {
+    this.bytecode.addStep('group', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal groupCount method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  groupCount(args) {
+    this.bytecode.addStep('groupCount', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal groupV3d0 method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  groupV3d0(args) {
+    this.bytecode.addStep('groupV3d0', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal has method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  has(args) {
+    this.bytecode.addStep('has', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal hasId method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  hasId(args) {
+    this.bytecode.addStep('hasId', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal hasKey method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  hasKey(args) {
+    this.bytecode.addStep('hasKey', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal hasLabel method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  hasLabel(args) {
+    this.bytecode.addStep('hasLabel', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal hasNot method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  hasNot(args) {
+    this.bytecode.addStep('hasNot', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal hasValue method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  hasValue(args) {
+    this.bytecode.addStep('hasValue', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal id method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  id(args) {
+    this.bytecode.addStep('id', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal identity method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  identity(args) {
+    this.bytecode.addStep('identity', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal in method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  in_(args) {
+    this.bytecode.addStep('in', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal inE method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  inE(args) {
+    this.bytecode.addStep('inE', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal inV method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  inV(args) {
+    this.bytecode.addStep('inV', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal inject method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  inject(args) {
+    this.bytecode.addStep('inject', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal is method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  is(args) {
+    this.bytecode.addStep('is', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal key method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  key(args) {
+    this.bytecode.addStep('key', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal label method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  label(args) {
+    this.bytecode.addStep('label', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal limit method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  limit(args) {
+    this.bytecode.addStep('limit', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal local method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  local(args) {
+    this.bytecode.addStep('local', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal loops method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  loops(args) {
+    this.bytecode.addStep('loops', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal map method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  map(args) {
+    this.bytecode.addStep('map', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal mapKeys method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  mapKeys(args) {
+    this.bytecode.addStep('mapKeys', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal mapValues method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  mapValues(args) {
+    this.bytecode.addStep('mapValues', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal match method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  match(args) {
+    this.bytecode.addStep('match', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal max method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  max(args) {
+    this.bytecode.addStep('max', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal mean method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  mean(args) {
+    this.bytecode.addStep('mean', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal min method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  min(args) {
+    this.bytecode.addStep('min', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal not method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  not(args) {
+    this.bytecode.addStep('not', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal option method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  option(args) {
+    this.bytecode.addStep('option', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal optional method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  optional(args) {
+    this.bytecode.addStep('optional', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal or method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  or(args) {
+    this.bytecode.addStep('or', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal order method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  order(args) {
+    this.bytecode.addStep('order', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal otherV method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  otherV(args) {
+    this.bytecode.addStep('otherV', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal out method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  out(args) {
+    this.bytecode.addStep('out', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal outE method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  outE(args) {
+    this.bytecode.addStep('outE', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal outV method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  outV(args) {
+    this.bytecode.addStep('outV', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal pageRank method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  pageRank(args) {
+    this.bytecode.addStep('pageRank', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal path method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  path(args) {
+    this.bytecode.addStep('path', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal peerPressure method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  peerPressure(args) {
+    this.bytecode.addStep('peerPressure', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal profile method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  profile(args) {
+    this.bytecode.addStep('profile', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal program method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  program(args) {
+    this.bytecode.addStep('program', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal project method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  project(args) {
+    this.bytecode.addStep('project', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal properties method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  properties(args) {
+    this.bytecode.addStep('properties', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal property method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  property(args) {
+    this.bytecode.addStep('property', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal propertyMap method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  propertyMap(args) {
+    this.bytecode.addStep('propertyMap', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal range method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  range(args) {
+    this.bytecode.addStep('range', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal repeat method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  repeat(args) {
+    this.bytecode.addStep('repeat', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal sack method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  sack(args) {
+    this.bytecode.addStep('sack', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal sample method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  sample(args) {
+    this.bytecode.addStep('sample', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal select method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  select(args) {
+    this.bytecode.addStep('select', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal sideEffect method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  sideEffect(args) {
+    this.bytecode.addStep('sideEffect', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal simplePath method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  simplePath(args) {
+    this.bytecode.addStep('simplePath', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal store method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  store(args) {
+    this.bytecode.addStep('store', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal subgraph method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  subgraph(args) {
+    this.bytecode.addStep('subgraph', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal sum method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  sum(args) {
+    this.bytecode.addStep('sum', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal tail method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  tail(args) {
+    this.bytecode.addStep('tail', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal timeLimit method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  timeLimit(args) {
+    this.bytecode.addStep('timeLimit', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal times method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  times(args) {
+    this.bytecode.addStep('times', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal to method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  to(args) {
+    this.bytecode.addStep('to', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal toE method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  toE(args) {
+    this.bytecode.addStep('toE', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal toV method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  toV(args) {
+    this.bytecode.addStep('toV', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal tree method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  tree(args) {
+    this.bytecode.addStep('tree', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal unfold method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  unfold(args) {
+    this.bytecode.addStep('unfold', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal union method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  union(args) {
+    this.bytecode.addStep('union', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal until method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  until(args) {
+    this.bytecode.addStep('until', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal value method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  value(args) {
+    this.bytecode.addStep('value', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal valueMap method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  valueMap(args) {
+    this.bytecode.addStep('valueMap', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal values method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  values(args) {
+    this.bytecode.addStep('values', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
+  /**
+   * Graph traversal where method.
+   * @param {...Object} args
+   * @returns {GraphTraversal}
+   */
+  where(args) {
+    this.bytecode.addStep('where', parseArgs.apply(null, arguments));
+    return this;
+  }
+  
 }
 
-inherits(GraphTraversal, t.Traversal);
-
-/**
- * Graph traversal V method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.V = function (args) {
-  this.bytecode.addStep('V', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal addE method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.addE = function (args) {
-  this.bytecode.addStep('addE', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal addInE method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.addInE = function (args) {
-  this.bytecode.addStep('addInE', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal addOutE method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.addOutE = function (args) {
-  this.bytecode.addStep('addOutE', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal addV method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.addV = function (args) {
-  this.bytecode.addStep('addV', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal aggregate method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.aggregate = function (args) {
-  this.bytecode.addStep('aggregate', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal and method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.and = function (args) {
-  this.bytecode.addStep('and', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal as method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.as = function (args) {
-  this.bytecode.addStep('as', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal barrier method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.barrier = function (args) {
-  this.bytecode.addStep('barrier', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal both method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.both = function (args) {
-  this.bytecode.addStep('both', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal bothE method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.bothE = function (args) {
-  this.bytecode.addStep('bothE', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal bothV method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.bothV = function (args) {
-  this.bytecode.addStep('bothV', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal branch method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.branch = function (args) {
-  this.bytecode.addStep('branch', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal by method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.by = function (args) {
-  this.bytecode.addStep('by', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal cap method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.cap = function (args) {
-  this.bytecode.addStep('cap', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal choose method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.choose = function (args) {
-  this.bytecode.addStep('choose', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal coalesce method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.coalesce = function (args) {
-  this.bytecode.addStep('coalesce', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal coin method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.coin = function (args) {
-  this.bytecode.addStep('coin', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal constant method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.constant = function (args) {
-  this.bytecode.addStep('constant', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal count method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.count = function (args) {
-  this.bytecode.addStep('count', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal cyclicPath method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.cyclicPath = function (args) {
-  this.bytecode.addStep('cyclicPath', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal dedup method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.dedup = function (args) {
-  this.bytecode.addStep('dedup', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal drop method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.drop = function (args) {
-  this.bytecode.addStep('drop', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal emit method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.emit = function (args) {
-  this.bytecode.addStep('emit', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal filter method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.filter = function (args) {
-  this.bytecode.addStep('filter', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal flatMap method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.flatMap = function (args) {
-  this.bytecode.addStep('flatMap', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal fold method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.fold = function (args) {
-  this.bytecode.addStep('fold', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal from method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.from_ = function (args) {
-  this.bytecode.addStep('from', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal group method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.group = function (args) {
-  this.bytecode.addStep('group', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal groupCount method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.groupCount = function (args) {
-  this.bytecode.addStep('groupCount', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal groupV3d0 method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.groupV3d0 = function (args) {
-  this.bytecode.addStep('groupV3d0', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal has method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.has = function (args) {
-  this.bytecode.addStep('has', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal hasId method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.hasId = function (args) {
-  this.bytecode.addStep('hasId', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal hasKey method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.hasKey = function (args) {
-  this.bytecode.addStep('hasKey', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal hasLabel method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.hasLabel = function (args) {
-  this.bytecode.addStep('hasLabel', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal hasNot method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.hasNot = function (args) {
-  this.bytecode.addStep('hasNot', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal hasValue method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.hasValue = function (args) {
-  this.bytecode.addStep('hasValue', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal id method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.id = function (args) {
-  this.bytecode.addStep('id', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal identity method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.identity = function (args) {
-  this.bytecode.addStep('identity', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal in method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.in_ = function (args) {
-  this.bytecode.addStep('in', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal inE method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.inE = function (args) {
-  this.bytecode.addStep('inE', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal inV method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.inV = function (args) {
-  this.bytecode.addStep('inV', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal inject method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.inject = function (args) {
-  this.bytecode.addStep('inject', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal is method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.is = function (args) {
-  this.bytecode.addStep('is', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal key method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.key = function (args) {
-  this.bytecode.addStep('key', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal label method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.label = function (args) {
-  this.bytecode.addStep('label', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal limit method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.limit = function (args) {
-  this.bytecode.addStep('limit', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal local method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.local = function (args) {
-  this.bytecode.addStep('local', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal loops method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.loops = function (args) {
-  this.bytecode.addStep('loops', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal map method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.map = function (args) {
-  this.bytecode.addStep('map', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal mapKeys method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.mapKeys = function (args) {
-  this.bytecode.addStep('mapKeys', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal mapValues method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.mapValues = function (args) {
-  this.bytecode.addStep('mapValues', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal match method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.match = function (args) {
-  this.bytecode.addStep('match', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal max method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.max = function (args) {
-  this.bytecode.addStep('max', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal mean method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.mean = function (args) {
-  this.bytecode.addStep('mean', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal min method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.min = function (args) {
-  this.bytecode.addStep('min', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal not method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.not = function (args) {
-  this.bytecode.addStep('not', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal option method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.option = function (args) {
-  this.bytecode.addStep('option', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal optional method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.optional = function (args) {
-  this.bytecode.addStep('optional', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal or method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.or = function (args) {
-  this.bytecode.addStep('or', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal order method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.order = function (args) {
-  this.bytecode.addStep('order', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal otherV method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.otherV = function (args) {
-  this.bytecode.addStep('otherV', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal out method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.out = function (args) {
-  this.bytecode.addStep('out', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal outE method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.outE = function (args) {
-  this.bytecode.addStep('outE', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal outV method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.outV = function (args) {
-  this.bytecode.addStep('outV', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal pageRank method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.pageRank = function (args) {
-  this.bytecode.addStep('pageRank', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal path method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.path = function (args) {
-  this.bytecode.addStep('path', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal peerPressure method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.peerPressure = function (args) {
-  this.bytecode.addStep('peerPressure', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal profile method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.profile = function (args) {
-  this.bytecode.addStep('profile', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal program method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.program = function (args) {
-  this.bytecode.addStep('program', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal project method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.project = function (args) {
-  this.bytecode.addStep('project', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal properties method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.properties = function (args) {
-  this.bytecode.addStep('properties', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal property method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.property = function (args) {
-  this.bytecode.addStep('property', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal propertyMap method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.propertyMap = function (args) {
-  this.bytecode.addStep('propertyMap', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal range method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.range = function (args) {
-  this.bytecode.addStep('range', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal repeat method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.repeat = function (args) {
-  this.bytecode.addStep('repeat', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal sack method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.sack = function (args) {
-  this.bytecode.addStep('sack', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal sample method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.sample = function (args) {
-  this.bytecode.addStep('sample', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal select method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.select = function (args) {
-  this.bytecode.addStep('select', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal sideEffect method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.sideEffect = function (args) {
-  this.bytecode.addStep('sideEffect', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal simplePath method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.simplePath = function (args) {
-  this.bytecode.addStep('simplePath', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal store method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.store = function (args) {
-  this.bytecode.addStep('store', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal subgraph method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.subgraph = function (args) {
-  this.bytecode.addStep('subgraph', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal sum method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.sum = function (args) {
-  this.bytecode.addStep('sum', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal tail method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.tail = function (args) {
-  this.bytecode.addStep('tail', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal timeLimit method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.timeLimit = function (args) {
-  this.bytecode.addStep('timeLimit', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal times method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.times = function (args) {
-  this.bytecode.addStep('times', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal to method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.to = function (args) {
-  this.bytecode.addStep('to', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal toE method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.toE = function (args) {
-  this.bytecode.addStep('toE', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal toV method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.toV = function (args) {
-  this.bytecode.addStep('toV', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal tree method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.tree = function (args) {
-  this.bytecode.addStep('tree', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal unfold method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.unfold = function (args) {
-  this.bytecode.addStep('unfold', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal union method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.union = function (args) {
-  this.bytecode.addStep('union', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal until method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.until = function (args) {
-  this.bytecode.addStep('until', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal value method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.value = function (args) {
-  this.bytecode.addStep('value', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal valueMap method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.valueMap = function (args) {
-  this.bytecode.addStep('valueMap', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal values method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.values = function (args) {
-  this.bytecode.addStep('values', parseArgs.apply(null, arguments));
-  return this;
-};
-
-/**
- * Graph traversal where method.
- * @param {...Object} args
- * @returns {GraphTraversal}
- */
-GraphTraversal.prototype.where = function (args) {
-  this.bytecode.addStep('where', parseArgs.apply(null, arguments));
-  return this;
-};
-
 /**
  * Contains the static method definitions
  * @type {Object}
  */
-var statics = {};
+const statics = {};
 
 /**
  * V() static method
@@ -1164,7 +1167,7 @@ var statics = {};
  * @returns {GraphTraversal}
  */
 statics.V = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.V.apply(g, arguments);
 };
 
@@ -1174,7 +1177,7 @@ statics.V = function (args) {
  * @returns {GraphTraversal}
  */
 statics.addE = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.addE.apply(g, arguments);
 };
 
@@ -1184,7 +1187,7 @@ statics.addE = function (args) {
  * @returns {GraphTraversal}
  */
 statics.addInE = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.addInE.apply(g, arguments);
 };
 
@@ -1194,7 +1197,7 @@ statics.addInE = function (args) {
  * @returns {GraphTraversal}
  */
 statics.addOutE = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.addOutE.apply(g, arguments);
 };
 
@@ -1204,7 +1207,7 @@ statics.addOutE = function (args) {
  * @returns {GraphTraversal}
  */
 statics.addV = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.addV.apply(g, arguments);
 };
 
@@ -1214,7 +1217,7 @@ statics.addV = function (args) {
  * @returns {GraphTraversal}
  */
 statics.aggregate = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.aggregate.apply(g, arguments);
 };
 
@@ -1224,7 +1227,7 @@ statics.aggregate = function (args) {
  * @returns {GraphTraversal}
  */
 statics.and = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.and.apply(g, arguments);
 };
 
@@ -1234,7 +1237,7 @@ statics.and = function (args) {
  * @returns {GraphTraversal}
  */
 statics.as = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.as.apply(g, arguments);
 };
 
@@ -1244,7 +1247,7 @@ statics.as = function (args) {
  * @returns {GraphTraversal}
  */
 statics.barrier = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.barrier.apply(g, arguments);
 };
 
@@ -1254,7 +1257,7 @@ statics.barrier = function (args) {
  * @returns {GraphTraversal}
  */
 statics.both = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.both.apply(g, arguments);
 };
 
@@ -1264,7 +1267,7 @@ statics.both = function (args) {
  * @returns {GraphTraversal}
  */
 statics.bothE = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.bothE.apply(g, arguments);
 };
 
@@ -1274,7 +1277,7 @@ statics.bothE = function (args) {
  * @returns {GraphTraversal}
  */
 statics.bothV = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.bothV.apply(g, arguments);
 };
 
@@ -1284,7 +1287,7 @@ statics.bothV = function (args) {
  * @returns {GraphTraversal}
  */
 statics.branch = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.branch.apply(g, arguments);
 };
 
@@ -1294,7 +1297,7 @@ statics.branch = function (args) {
  * @returns {GraphTraversal}
  */
 statics.cap = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.cap.apply(g, arguments);
 };
 
@@ -1304,7 +1307,7 @@ statics.cap = function (args) {
  * @returns {GraphTraversal}
  */
 statics.choose = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.choose.apply(g, arguments);
 };
 
@@ -1314,7 +1317,7 @@ statics.choose = function (args) {
  * @returns {GraphTraversal}
  */
 statics.coalesce = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.coalesce.apply(g, arguments);
 };
 
@@ -1324,7 +1327,7 @@ statics.coalesce = function (args) {
  * @returns {GraphTraversal}
  */
 statics.coin = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.coin.apply(g, arguments);
 };
 
@@ -1334,7 +1337,7 @@ statics.coin = function (args) {
  * @returns {GraphTraversal}
  */
 statics.constant = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.constant.apply(g, arguments);
 };
 
@@ -1344,7 +1347,7 @@ statics.constant = function (args) {
  * @returns {GraphTraversal}
  */
 statics.count = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.count.apply(g, arguments);
 };
 
@@ -1354,7 +1357,7 @@ statics.count = function (args) {
  * @returns {GraphTraversal}
  */
 statics.cyclicPath = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.cyclicPath.apply(g, arguments);
 };
 
@@ -1364,7 +1367,7 @@ statics.cyclicPath = function (args) {
  * @returns {GraphTraversal}
  */
 statics.dedup = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.dedup.apply(g, arguments);
 };
 
@@ -1374,7 +1377,7 @@ statics.dedup = function (args) {
  * @returns {GraphTraversal}
  */
 statics.drop = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.drop.apply(g, arguments);
 };
 
@@ -1384,7 +1387,7 @@ statics.drop = function (args) {
  * @returns {GraphTraversal}
  */
 statics.emit = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.emit.apply(g, arguments);
 };
 
@@ -1394,7 +1397,7 @@ statics.emit = function (args) {
  * @returns {GraphTraversal}
  */
 statics.filter = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.filter.apply(g, arguments);
 };
 
@@ -1404,7 +1407,7 @@ statics.filter = function (args) {
  * @returns {GraphTraversal}
  */
 statics.flatMap = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.flatMap.apply(g, arguments);
 };
 
@@ -1414,7 +1417,7 @@ statics.flatMap = function (args) {
  * @returns {GraphTraversal}
  */
 statics.fold = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.fold.apply(g, arguments);
 };
 
@@ -1424,7 +1427,7 @@ statics.fold = function (args) {
  * @returns {GraphTraversal}
  */
 statics.group = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.group.apply(g, arguments);
 };
 
@@ -1434,7 +1437,7 @@ statics.group = function (args) {
  * @returns {GraphTraversal}
  */
 statics.groupCount = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.groupCount.apply(g, arguments);
 };
 
@@ -1444,7 +1447,7 @@ statics.groupCount = function (args) {
  * @returns {GraphTraversal}
  */
 statics.groupV3d0 = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.groupV3d0.apply(g, arguments);
 };
 
@@ -1454,7 +1457,7 @@ statics.groupV3d0 = function (args) {
  * @returns {GraphTraversal}
  */
 statics.has = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.has.apply(g, arguments);
 };
 
@@ -1464,7 +1467,7 @@ statics.has = function (args) {
  * @returns {GraphTraversal}
  */
 statics.hasId = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.hasId.apply(g, arguments);
 };
 
@@ -1474,7 +1477,7 @@ statics.hasId = function (args) {
  * @returns {GraphTraversal}
  */
 statics.hasKey = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.hasKey.apply(g, arguments);
 };
 
@@ -1484,7 +1487,7 @@ statics.hasKey = function (args) {
  * @returns {GraphTraversal}
  */
 statics.hasLabel = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.hasLabel.apply(g, arguments);
 };
 
@@ -1494,7 +1497,7 @@ statics.hasLabel = function (args) {
  * @returns {GraphTraversal}
  */
 statics.hasNot = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.hasNot.apply(g, arguments);
 };
 
@@ -1504,7 +1507,7 @@ statics.hasNot = function (args) {
  * @returns {GraphTraversal}
  */
 statics.hasValue = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.hasValue.apply(g, arguments);
 };
 
@@ -1514,7 +1517,7 @@ statics.hasValue = function (args) {
  * @returns {GraphTraversal}
  */
 statics.id = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.id.apply(g, arguments);
 };
 
@@ -1524,7 +1527,7 @@ statics.id = function (args) {
  * @returns {GraphTraversal}
  */
 statics.identity = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.identity.apply(g, arguments);
 };
 
@@ -1534,7 +1537,7 @@ statics.identity = function (args) {
  * @returns {GraphTraversal}
  */
 statics.in_ = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.in_.apply(g, arguments);
 };
 
@@ -1544,7 +1547,7 @@ statics.in_ = function (args) {
  * @returns {GraphTraversal}
  */
 statics.inE = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.inE.apply(g, arguments);
 };
 
@@ -1554,7 +1557,7 @@ statics.inE = function (args) {
  * @returns {GraphTraversal}
  */
 statics.inV = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.inV.apply(g, arguments);
 };
 
@@ -1564,7 +1567,7 @@ statics.inV = function (args) {
  * @returns {GraphTraversal}
  */
 statics.inject = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.inject.apply(g, arguments);
 };
 
@@ -1574,7 +1577,7 @@ statics.inject = function (args) {
  * @returns {GraphTraversal}
  */
 statics.is = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.is.apply(g, arguments);
 };
 
@@ -1584,7 +1587,7 @@ statics.is = function (args) {
  * @returns {GraphTraversal}
  */
 statics.key = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.key.apply(g, arguments);
 };
 
@@ -1594,7 +1597,7 @@ statics.key = function (args) {
  * @returns {GraphTraversal}
  */
 statics.label = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.label.apply(g, arguments);
 };
 
@@ -1604,7 +1607,7 @@ statics.label = function (args) {
  * @returns {GraphTraversal}
  */
 statics.limit = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.limit.apply(g, arguments);
 };
 
@@ -1614,7 +1617,7 @@ statics.limit = function (args) {
  * @returns {GraphTraversal}
  */
 statics.local = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.local.apply(g, arguments);
 };
 
@@ -1624,7 +1627,7 @@ statics.local = function (args) {
  * @returns {GraphTraversal}
  */
 statics.loops = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.loops.apply(g, arguments);
 };
 
@@ -1634,7 +1637,7 @@ statics.loops = function (args) {
  * @returns {GraphTraversal}
  */
 statics.map = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.map.apply(g, arguments);
 };
 
@@ -1644,7 +1647,7 @@ statics.map = function (args) {
  * @returns {GraphTraversal}
  */
 statics.mapKeys = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.mapKeys.apply(g, arguments);
 };
 
@@ -1654,7 +1657,7 @@ statics.mapKeys = function (args) {
  * @returns {GraphTraversal}
  */
 statics.mapValues = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.mapValues.apply(g, arguments);
 };
 
@@ -1664,7 +1667,7 @@ statics.mapValues = function (args) {
  * @returns {GraphTraversal}
  */
 statics.match = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.match.apply(g, arguments);
 };
 
@@ -1674,7 +1677,7 @@ statics.match = function (args) {
  * @returns {GraphTraversal}
  */
 statics.max = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.max.apply(g, arguments);
 };
 
@@ -1684,7 +1687,7 @@ statics.max = function (args) {
  * @returns {GraphTraversal}
  */
 statics.mean = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.mean.apply(g, arguments);
 };
 
@@ -1694,7 +1697,7 @@ statics.mean = function (args) {
  * @returns {GraphTraversal}
  */
 statics.min = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.min.apply(g, arguments);
 };
 
@@ -1704,7 +1707,7 @@ statics.min = function (args) {
  * @returns {GraphTraversal}
  */
 statics.not = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.not.apply(g, arguments);
 };
 
@@ -1714,7 +1717,7 @@ statics.not = function (args) {
  * @returns {GraphTraversal}
  */
 statics.optional = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.optional.apply(g, arguments);
 };
 
@@ -1724,7 +1727,7 @@ statics.optional = function (args) {
  * @returns {GraphTraversal}
  */
 statics.or = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.or.apply(g, arguments);
 };
 
@@ -1734,7 +1737,7 @@ statics.or = function (args) {
  * @returns {GraphTraversal}
  */
 statics.order = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.order.apply(g, arguments);
 };
 
@@ -1744,7 +1747,7 @@ statics.order = function (args) {
  * @returns {GraphTraversal}
  */
 statics.otherV = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.otherV.apply(g, arguments);
 };
 
@@ -1754,7 +1757,7 @@ statics.otherV = function (args) {
  * @returns {GraphTraversal}
  */
 statics.out = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.out.apply(g, arguments);
 };
 
@@ -1764,7 +1767,7 @@ statics.out = function (args) {
  * @returns {GraphTraversal}
  */
 statics.outE = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.outE.apply(g, arguments);
 };
 
@@ -1774,7 +1777,7 @@ statics.outE = function (args) {
  * @returns {GraphTraversal}
  */
 statics.outV = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.outV.apply(g, arguments);
 };
 
@@ -1784,7 +1787,7 @@ statics.outV = function (args) {
  * @returns {GraphTraversal}
  */
 statics.path = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.path.apply(g, arguments);
 };
 
@@ -1794,7 +1797,7 @@ statics.path = function (args) {
  * @returns {GraphTraversal}
  */
 statics.project = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.project.apply(g, arguments);
 };
 
@@ -1804,7 +1807,7 @@ statics.project = function (args) {
  * @returns {GraphTraversal}
  */
 statics.properties = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.properties.apply(g, arguments);
 };
 
@@ -1814,7 +1817,7 @@ statics.properties = function (args) {
  * @returns {GraphTraversal}
  */
 statics.property = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.property.apply(g, arguments);
 };
 
@@ -1824,7 +1827,7 @@ statics.property = function (args) {
  * @returns {GraphTraversal}
  */
 statics.propertyMap = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.propertyMap.apply(g, arguments);
 };
 
@@ -1834,7 +1837,7 @@ statics.propertyMap = function (args) {
  * @returns {GraphTraversal}
  */
 statics.range = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.range.apply(g, arguments);
 };
 
@@ -1844,7 +1847,7 @@ statics.range = function (args) {
  * @returns {GraphTraversal}
  */
 statics.repeat = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.repeat.apply(g, arguments);
 };
 
@@ -1854,7 +1857,7 @@ statics.repeat = function (args) {
  * @returns {GraphTraversal}
  */
 statics.sack = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.sack.apply(g, arguments);
 };
 
@@ -1864,7 +1867,7 @@ statics.sack = function (args) {
  * @returns {GraphTraversal}
  */
 statics.sample = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.sample.apply(g, arguments);
 };
 
@@ -1874,7 +1877,7 @@ statics.sample = function (args) {
  * @returns {GraphTraversal}
  */
 statics.select = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.select.apply(g, arguments);
 };
 
@@ -1884,7 +1887,7 @@ statics.select = function (args) {
  * @returns {GraphTraversal}
  */
 statics.sideEffect = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.sideEffect.apply(g, arguments);
 };
 
@@ -1894,7 +1897,7 @@ statics.sideEffect = function (args) {
  * @returns {GraphTraversal}
  */
 statics.simplePath = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.simplePath.apply(g, arguments);
 };
 
@@ -1904,7 +1907,7 @@ statics.simplePath = function (args) {
  * @returns {GraphTraversal}
  */
 statics.store = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.store.apply(g, arguments);
 };
 
@@ -1914,7 +1917,7 @@ statics.store = function (args) {
  * @returns {GraphTraversal}
  */
 statics.subgraph = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.subgraph.apply(g, arguments);
 };
 
@@ -1924,7 +1927,7 @@ statics.subgraph = function (args) {
  * @returns {GraphTraversal}
  */
 statics.sum = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.sum.apply(g, arguments);
 };
 
@@ -1934,7 +1937,7 @@ statics.sum = function (args) {
  * @returns {GraphTraversal}
  */
 statics.tail = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.tail.apply(g, arguments);
 };
 
@@ -1944,7 +1947,7 @@ statics.tail = function (args) {
  * @returns {GraphTraversal}
  */
 statics.timeLimit = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.timeLimit.apply(g, arguments);
 };
 
@@ -1954,7 +1957,7 @@ statics.timeLimit = function (args) {
  * @returns {GraphTraversal}
  */
 statics.times = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.times.apply(g, arguments);
 };
 
@@ -1964,7 +1967,7 @@ statics.times = function (args) {
  * @returns {GraphTraversal}
  */
 statics.to = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.to.apply(g, arguments);
 };
 
@@ -1974,7 +1977,7 @@ statics.to = function (args) {
  * @returns {GraphTraversal}
  */
 statics.toE = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.toE.apply(g, arguments);
 };
 
@@ -1984,7 +1987,7 @@ statics.toE = function (args) {
  * @returns {GraphTraversal}
  */
 statics.toV = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.toV.apply(g, arguments);
 };
 
@@ -1994,7 +1997,7 @@ statics.toV = function (args) {
  * @returns {GraphTraversal}
  */
 statics.tree = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.tree.apply(g, arguments);
 };
 
@@ -2004,7 +2007,7 @@ statics.tree = function (args) {
  * @returns {GraphTraversal}
  */
 statics.unfold = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.unfold.apply(g, arguments);
 };
 
@@ -2014,7 +2017,7 @@ statics.unfold = function (args) {
  * @returns {GraphTraversal}
  */
 statics.union = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.union.apply(g, arguments);
 };
 
@@ -2024,7 +2027,7 @@ statics.union = function (args) {
  * @returns {GraphTraversal}
  */
 statics.until = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.until.apply(g, arguments);
 };
 
@@ -2034,7 +2037,7 @@ statics.until = function (args) {
  * @returns {GraphTraversal}
  */
 statics.value = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.value.apply(g, arguments);
 };
 
@@ -2044,7 +2047,7 @@ statics.value = function (args) {
  * @returns {GraphTraversal}
  */
 statics.valueMap = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.valueMap.apply(g, arguments);
 };
 
@@ -2054,7 +2057,7 @@ statics.valueMap = function (args) {
  * @returns {GraphTraversal}
  */
 statics.values = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.values.apply(g, arguments);
 };
 
@@ -2064,12 +2067,12 @@ statics.values = function (args) {
  * @returns {GraphTraversal}
  */
 statics.where = function (args) {
-  var g = new GraphTraversal(null, null, new Bytecode());
+  const g = new GraphTraversal(null, null, new Bytecode());
   return g.where.apply(g, arguments);
 };
 
 module.exports = {
-  GraphTraversal: GraphTraversal,
-  GraphTraversalSource: GraphTraversalSource,
-  statics: statics
+  GraphTraversal,
+  GraphTraversalSource,
+  statics
 };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d458f76d/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.js
----------------------------------------------------------------------
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.js
index 22d6498..fbc3fba 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal-strategy.js
@@ -22,66 +22,63 @@
  */
 'use strict';
 
-var utils = require('../utils');
+const utils = require('../utils');
 
-/**
- * Creates a new instance of TraversalStrategies.
- * @param {TraversalStrategies} [parent] The parent strategies from where to clone the values from.
- * @param {Function} [promiseFactory] The factory used to create the A+ Promise instances. Use it when you want to
- * create Promise instances without using ECMAScript Promise constructor, ie: bluebird or Q promises.
- * @constructor
- */
-function TraversalStrategies(parent, promiseFactory) {
-  if (parent) {
-    // Clone the strategies
-    this.strategies = parent.strategies.slice(0);
-    this.promiseFactory = parent.promiseFactory;
+class TraversalStrategies {
+  /**
+   * Creates a new instance of TraversalStrategies.
+   * @param {TraversalStrategies} [parent] The parent strategies from where to clone the values from.
+   * @param {Function} [promiseFactory] The factory used to create the A+ Promise instances. Use it when you want to
+   * create Promise instances without using ECMAScript Promise constructor, ie: bluebird or Q promises.
+   * @constructor
+   */
+  constructor(parent, promiseFactory) {
+    if (parent) {
+      // Clone the strategies
+      this.strategies = parent.strategies.slice(0);
+      this.promiseFactory = parent.promiseFactory;
+    }
+    else {
+      this.strategies = [];
+    }
+    if (promiseFactory) {
+      this.promiseFactory = promiseFactory;
+    }
   }
-  else {
-    this.strategies = [];
+
+  /** @param {TraversalStrategy} strategy */
+  addStrategy(strategy) {
+    this.strategies.push(strategy);
   }
-  if (promiseFactory) {
-    this.promiseFactory = promiseFactory;
+
+  /**
+   * @param {Traversal} traversal
+   * @returns {Promise}
+   */
+  applyStrategies(traversal) {
+    // Apply all strategies serially
+    const self = this;
+    return this.strategies.reduce(function reduceItem(promise, strategy) {
+      return promise.then(function () {
+        return strategy.apply(traversal, self.promiseFactory);
+      });
+    }, utils.resolvedPromise(this.promiseFactory));
   }
 }
 
-/** @param {TraversalStrategy} strategy */
-TraversalStrategies.prototype.addStrategy = function (strategy) {
-  this.strategies.push(strategy);
-};
-
-/**
- * @param {Traversal} traversal
- * @returns {Promise}
- */
-TraversalStrategies.prototype.applyStrategies = function (traversal) {
-  // Apply all strategies serially
-  var self = this;
-  return this.strategies.reduce(function reduceItem(promise, strategy) {
-    return promise.then(function () {
-      return strategy.apply(traversal, self.promiseFactory);
-    });
-  }, utils.resolvedPromise(this.promiseFactory));
-};
-
-/**
- * @abstract
- * @constructor
- */
-function TraversalStrategy() {
+/** @abstract */
+class TraversalStrategy {
+  /**
+   * @abstract
+   * @param {Traversal} traversal
+   * @param {Function|undefined} promiseFactory
+   * @returns {Promise}
+   */
+  apply(traversal, promiseFactory) {
 
+  }
 }
 
-/**
- * @abstract
- * @param {Traversal} traversal
- * @param {Function|undefined} promiseFactory
- * @returns {Promise}
- */
-TraversalStrategy.prototype.apply = function (traversal, promiseFactory) {
-
-};
-
 module.exports = {
   TraversalStrategies: TraversalStrategies,
   TraversalStrategy: TraversalStrategy


Mime
View raw message