Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2432

Generate correct toString() representation of bytecode in Javascript

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.4.8
    • 3.5.0, 3.4.9
    • javascript
    • None

    Description

      I have a very simple task - generate bytecode using typescript traversal. 

      for example: 
      const g = new Graph().traversal();
      const q = g.V().hasLabel("airport").where(__.outE("route").hasId(7753));
      const query = new translator("g" as any);
      const bytecode = q.getBytecode();
      console.log(`Bytecode: ${bytecode.toString()}`);
       
      Here is what is generated: 
       
      Bytecode: [["V"],["hasLabel","airport"],["where",{"graph":null,"traversalStrategies":null,"bytecode":

      {"sourceInstructions":[],"stepInstructions":[["outE","route"],["hasId",7753]]}

      ,"traversers":null,"sideEffects":null,"_traversalStrategiesPromise":null,"_traversersIteratorIndex":0}]]
       
      Looks like it does the first level serialization correct, but the second level isn't properly serialized. 
       
      any suggestions what is wrong with this code?

      Attachments

        Issue Links

          Activity

            People

              spmallette Stephen Mallette
              serguk86 Serg Salo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: