Skip to content

eval should sometimes make an entry in the ENGINE_SCOPE bindings #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mslinn opened this issue Dec 5, 2017 · 1 comment
Closed
Labels

Comments

@mslinn
Copy link

mslinn commented Dec 5, 2017

scripting-scala's eval function 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:

eval("val twelve = 12")

I exercise several JSR233 implementations in a test suite here, and highlight this issue here.

The scripting-java and scripting-clojure projects probably suffer from the same bug.

@ctrueden ctrueden added the bug label Aug 26, 2019
jpsacha added a commit that referenced this issue May 9, 2023
@jpsacha
Copy link
Member

jpsacha commented May 9, 2023

Implementations moved recently to Scala 3 and its implementation of the Script Engine. That implementation currently has no support for bindings (scala/scala3#17237). However, the bindings are emulated in the new ScalaAdaptedScriptEngine.

I added a test to verify the the issue reported here was addressed:

@jpsacha jpsacha closed this as completed May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants