[
https://issues.apache.org/jira/browse/TINKERPOP-1959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16594277#comment-16594277
]
ASF GitHub Bot commented on TINKERPOP-1959:
-------------------------------------------
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') {`
> 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)