[
https://issues.apache.org/jira/browse/TINKERPOP-1792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16181763#comment-16181763
]
ASF GitHub Bot commented on TINKERPOP-1792:
-------------------------------------------
GitHub user spmallette opened a pull request:
https://github.com/apache/tinkerpop/pull/723
TINKERPOP-1792 Fixed GremlinScriptEngine bug in lambda processing
https://issues.apache.org/jira/browse/TINKERPOP-1792
GremlinScriptEngine instances should now properly select the appropriate
TraversalSource from bindings rather than select a random one. The
TraversalSource is locally aliased to a "hidden" variable at the time of
evaluation to avoid naming clashes with local variables defined in the bytecode
itself. Added a number of validations to be sure that users get appropriate
errors if they try to use the eval() method the wrong way. Included new tests
to ensure that GremlinScriptEngine have the appropriate behavior.
All tests pass with `docker/build.sh -t -n -i`
VOTE +1
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1792
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/723.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #723
----
commit 30185646379b051b81484dd75ad34490fa7461b8
Author: Stephen Mallette <[email protected]>
Date: 2017-09-26T15:31:31Z
TINKERPOP-1792 Fixed GremlinScriptEngine bug in lambda processing
GremlinScriptEngine instances should now properly select the appropriate
TraversalSource from bindings rather than select a random one. The
TraversalSource is locally aliased to a "hidden" variable at the time of
evaluation to avoid naming clashes with local variables defined in the bytecode
itself. Added a number of validations to be sure that users get appropriate
errors if they try to use the eval() method the wrong way. Included new tests
to ensure that GremlinScriptEngine have the appropriate behavior.
----
> Random TraversalSource Selection in GremlinScriptEngine
> -------------------------------------------------------
>
> Key: TINKERPOP-1792
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1792
> Project: TinkerPop
> Issue Type: Bug
> Affects Versions: 3.2.6
> Reporter: stephen mallette
> Priority: Critical
> Labels: deprecation
>
> {{GremlinScriptEngine}} implementations make a random {{TraversalSource}}
> selection when processing lambdas. Obviously it should be bound more clearly
> to the specific {{TraversalSource}} the caller requests. Another issue that
> isn't completely clear is that bindings passed from the client share the same
> namespace as {{TraversalSource}} bindings which means that if the
> {{TraversalSource}} is "g" then you couldn't write a traversal like:
> {{withSideEffect(“g”, “hello”)}}. That could be smarter as well.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)