Currently Nashorn script stack traces display Java method names instead of JS function names. Java method names are composed from the function name appended to the names of its parent functions using '$' as separator. If any function in the chain is anonymous, the function itself will be displayed as "<anonymous>" in the stack trace.
To solve this, we need to use a character that is not a valid ECMA identifier character as method separator name, but is allowed in Java method names. This would allow us to get the original function name from the Java method name and display it in script stack traces.