-
Notifications
You must be signed in to change notification settings - Fork 82
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
Different execution outcome between the Sandbox and Nashorn executed directly #57
Comments
Strange enough, the same test above passes on |
Thank you for reporting this issue and please excuse the delay. Hmm, that's really interesting. Let me add a unit test for this ... |
When I run this test, I get:
|
When removing '--no-java' it works. Might it be that Nashorn uses Java internally for implementing the map function? |
Thanks for following up on the issue. The issue in here (and the reason I filed it as an issue on this repo) is that there is a difference between Nashorn and the sandbox. Note that the NASHORN_ARGS I provided above are passed to both the Nashorn engine as well as the sandbox. Therefore, if this was a problem at engine level, then running it directly with nashorn should have also triggered the fault. However, note that on the same test case, the failure actually happens on line 25 ( Could it be that the sandbox is injecting additional code that requires Java execution? And if so, can it be disabled when |
Thank you for further looking into this! The sandbox indeed depends on a Java class to function properly. The best solution I could come up with is to disallow using the engine parameter I don't think any Java classes should be available anyway when .disallowAllClasses can be used. Or are there any other restrictions which can only be achieved with |
Fair enough. Is there a documentation of what java code (or additional code) sandbox executes along with the requested scripts? Moreover, how confident can one be of the |
If you add the following to your log4j properties it will output the code generated:
Please be welcome to do tests on how well |
Thanks, that's helpful. I'll create new issues if I find any further challenges. |
Hello again. I'm a bit at loss trying to figure out why the following script executes fine with Nashorn when executed directly, but does not work with the NashornSandbox.
The eval on NashornSandboxes triggers the following exception:
javax.script.ScriptException: TypeError: null has no such function "type" in <eval> at line number 1
.Please find below a unit test for this:
The text was updated successfully, but these errors were encountered: