You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a sandbox instance is created and it disallows no-braces, it throws an exception when the JS code to evaluate starts with any of { function, for, while, do }. Basically, the exception's stacktrace says:
Exception in thread "main" delight.nashornsandbox.exceptions.BracesException: No block braces after function|for|while|do
at delight.nashornsandbox.internal.JsSanitizer.checkBraces(JsSanitizer.java:177)
at delight.nashornsandbox.internal.JsSanitizer.secureJs(JsSanitizer.java:220)
at delight.nashornsandbox.internal.NashornSandboxImpl.eval(NashornSandboxImpl.java:129)
at delight.nashornsandbox.internal.NashornSandboxImpl.eval(NashornSandboxImpl.java:104)
...
It looks like the block braces pattern matching makes it fail whenever the text starts with do. This code can reproduce the issue:
When a sandbox instance is created and it disallows no-braces, it throws an exception when the JS code to evaluate starts with any of { function, for, while, do }. Basically, the exception's stacktrace says:
It looks like the block braces pattern matching makes it fail whenever the text starts with
do
. This code can reproduce the issue:The text was updated successfully, but these errors were encountered: