You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Mike Slinn (JIRA)" <ji...@apache.org> on 2017/12/02 21:50:00 UTC

[jira] [Updated] (GROOVY-8400) eval should sometimes make an entry in the ENGINE_SCOPE bindings

     [ https://issues.apache.org/jira/browse/GROOVY-8400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Slinn updated GROOVY-8400:
-------------------------------
    Description: 
GROOVY-3707 resulted in the implementation JSR223's eval function, but that behavior does not quite match the JSR233 implementations for Nashorn and Jython. Specifically, eval should make an entry in the ScriptContext.ENGINE_SCOPE bindings whenever it receives a string that causes a new variable or method to be defined.

For example, this should cause a new variable called twelve to be defined:

{code:java}
eval("def twelve = ten + 2")
{code}

I demonstrate all three JSR233 implementations in a test suite here, and highlight this issue here:
https://github.com/mslinn/cli-loop/blob/master/src/test/scala/com/micronautics/cli/TestyMcTestFace.scala#L40-L46

  was:
GROOVY-3707 resulted in the implementation JSR223's eval function, but that behavior does not quite match the JSR233 implementations for Nashorn and Jython. Specifically, eval should make an entry in the ScriptContext.ENGINE_SCOPE bindings whenever it receives a string that causes a new variable or method to be defined.

For example, this should cause a new variable called twelve to be defined:

{code:java}
eval("def twelve = ten + 2")
{code}



> eval should sometimes make an entry in the ENGINE_SCOPE bindings
> ----------------------------------------------------------------
>
>                 Key: GROOVY-8400
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8400
>             Project: Groovy
>          Issue Type: Bug
>          Components: GroovyScriptEngine
>    Affects Versions: 2.4.12
>            Reporter: Mike Slinn
>            Priority: Minor
>              Labels: newbie
>
> GROOVY-3707 resulted in the implementation JSR223's eval function, but that behavior does not quite match the JSR233 implementations for Nashorn and Jython. Specifically, eval should make an entry in the ScriptContext.ENGINE_SCOPE bindings whenever it receives a string that causes a new variable or method to be defined.
> For example, this should cause a new variable called twelve to be defined:
> {code:java}
> eval("def twelve = ten + 2")
> {code}
> I demonstrate all three JSR233 implementations in a test suite here, and highlight this issue here:
> https://github.com/mslinn/cli-loop/blob/master/src/test/scala/com/micronautics/cli/TestyMcTestFace.scala#L40-L46



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)