mozilla/rhino — pull request #119 by mauri (2013-05-25 07:00:49+00:00)
Title: Set optimization level to -1 when generating debug information

if the optimization level is greater than 0 and org.mozilla.javascript.Context#setGeneratingDebug(true) is called it sets the optimization level back to 0. However, org.mozilla.javascript.Context#createCompiler creates a Codegen instance to compile the script if the optimizationLevel is greater or equals to 0.

If a debugger is attached to the Context, the script evaluation (or compilation) fails with a RuntimeException:NOT SUPPORTED as it can't notify a non DebuggableScript instance.