Github user bterlson commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/922#discussion_r213130596
  
    --- Diff: 
gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/remote-connection.js
 ---
    @@ -66,7 +67,27 @@ class RemoteStrategy extends TraversalStrategy {
         if (traversal.traversers) {
           return Promise.resolve();
         }
    -    return this.connection.submit(traversal.getBytecode()).then(function 
(remoteTraversal) {
    +
    +    let instructions = traversal.getBytecode();
    +    let op = 'bytecode';
    +    let processor = 'traversal';
    +    let args = null;
    +
    +    // check if the last instruction is an eval statement
    +    if (instructions.stepInstructions.length && 
instructions.stepInstructions[instructions.stepInstructions.length-1][0] === 
'eval') {
    --- End diff --
    
    Aliasing `instructions.stepInstructions` will make this line easier to read.
    
    Could also consider relying on the falsiness of empty arrays and simplify 
to `if (sis && sis[sis.length-1][0] === 'eval') {`


---

Reply via email to