-
Notifications
You must be signed in to change notification settings - Fork 83
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
Ability to provide arguments to getScriptEngine #40
Comments
Hi Sina, Thank you for submitting this issue. I think it is always great to find ways to make the API more useful. Please see in the linked commit the change which will allow to create a new Sandbox as follows:
Could you point me to documentation what arguments are allowed? Could you think of a test case we could create to test this feature? Thank you! |
@mxro , thanks a lot for this!! really appreciate that you implemented the feature in the library. Regarding documentation of the arguments, there's this official documentation ( http://hg.openjdk.java.net/jdk8/jdk8/nashorn/file/tip/docs/DEVELOPER_README ), but I don't know if there's a more accessible version of it. Here's also some source reference to these properties: https://github.com/JetBrains/jdk8u_nashorn/blob/master/src/jdk/nashorn/internal/runtime/resources/Options.properties There are quite a few options such as Re. test cases, I'm particularly keen on |
Thank you for the information. I have added this to the documentation, creating a test case and released a new version to Maven central with the additional method in NashornSandboxes added. I hope this solves this issue for you! |
Thanks a lot. This is really great work. I'll update here if I find an issue in production. |
Hello again. Perhaps it'd make sense if I create a separate issue, but since it's relevant to this change, I comment here. It seems that enabling strict mode has a conflict with delight. In particular, quit=function(){};exit=function(){};print=function(){};echo = function(){};readFully=function(){};readLine=function(){};load=function(){};loadWithNewGlobal=function(){};$ARG=null;$ENV=null;$EXEC=null;$OPTIONS=null;$OUT=null;$ERR=null;$EXIT=null; Would appending |
Thank you for reopening the issue and reporting this. I have changed the declaration of the variables. Can you test if this would work for you? |
For testing, I could use scenarios in the following format: |
Would it be possible to extend the library, such that it'd be possible to pass arguments to
getScriptEngine
such as"-strict", "--no-java", "--no-syntax-extensions"
?It'd be a great help since this library already provides sandboxing features such as CPU limits, etc.
The text was updated successfully, but these errors were encountered: