[ 
https://issues.apache.org/jira/browse/TINKERPOP-1959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16602735#comment-16602735
 ] 

ASF GitHub Bot commented on TINKERPOP-1959:
-------------------------------------------

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

    https://github.com/apache/tinkerpop/pull/922#discussion_r214823388
  
    --- Diff: 
gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/driver-remote-connection.js
 ---
    @@ -114,24 +114,26 @@ class DriverRemoteConnection extends RemoteConnection 
{
               result: null
             };
           }
    -      const message = bufferFromString(this._header + 
JSON.stringify(this._getRequest(requestId, bytecode, op, args)));
    +
    +      const message = bufferFromString(this._header + 
JSON.stringify(this._getRequest(requestId, bytecode, op, args, processor)));
           this._ws.send(message);
         }));
       }
     
    -  _getRequest(id, bytecode, op, args) {
    +  _getRequest(id, bytecode, op, args, processor) {
         if (args) {
           args = this._adaptArgs(args);
         }
    -
    +    
         return ({
           'requestId': { '@type': 'g:UUID', '@value': id },
           'op': op || 'bytecode',
    -      'processor': 'traversal',
    +      // if using op eval need to ensure processor stays unset if caller 
didn't set it.
    +      'processor': (!processor && op !== 'eval') ? 'traversal' : processor,
           'args': args || {
    -        'gremlin': this._writer.adaptObject(bytecode),
    -        'aliases': { 'g': this.traversalSource }
    -      }
    +          'gremlin': this._writer.adaptObject(bytecode),
    --- End diff --
    
    NIT: Use 2 spaces instead of 4 in the following lines.


> Provide a way to submit scripts to the server in gremlin-javascript
> -------------------------------------------------------------------
>
>                 Key: TINKERPOP-1959
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1959
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: javascript
>    Affects Versions: 3.2.8
>            Reporter: stephen mallette
>            Priority: Critical
>
> It is currently only possible to submit bytecode based requests to the server 
> with gremlin-javascript. We should also provide some means for submitting 
> scripts.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to