groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Slinn (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-8400) eval should sometimes make an entry in the ENGINE_SCOPE bindings
Date Sat, 02 Dec 2017 21:50:00 GMT

     [ 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)

Mime
View raw message