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

    https://github.com/apache/tinkerpop/pull/889#discussion_r201296778
  
    --- Diff: 
gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js
 ---
    @@ -100,24 +105,24 @@ class DriverRemoteConnection extends RemoteConnection 
{
       }
     
       /** @override */
    -  submit(bytecode) {
    +  submit(bytecode, op, args) {
         return this.open().then(() => new Promise((resolve, reject) => {
    -      const requestId = getUuid();
    +      const requestId = utils.getUuid();
           this._responseHandlers[requestId] = {
             callback: (err, result) => err ? reject(err) : resolve(result),
             result: null
           };
    -      const message = bufferFromString(this._header + 
JSON.stringify(this._getRequest(requestId, bytecode)));
    +      const message = bufferFromString(this._header + 
JSON.stringify(this._getRequest(requestId, bytecode, op, args)));
           this._ws.send(message);
         }));
       }
     
    -  _getRequest(id, bytecode) {
    +  _getRequest(id, bytecode, op, args) {
         return ({
           'requestId': { '@type': 'g:UUID', '@value': id },
    -      'op': 'bytecode',
    +      'op': op || 'bytecode',
           'processor': 'traversal',
    -      'args': {
    +      'args': args || {
    --- End diff --
    
    I think each value of args map should be encoded with 
`this._writer.adaptObject()`


---

Reply via email to