Details
-
Sub-task
-
Resolution: Fixed
-
P3
-
8
-
None
-
b102
-
generic
-
generic
-
Verified
Description
jjs -doe
jjs> function makeSwitch(from,to,v){var r="switch("+v+"){"; for (var i=from;i<to;++i)r+="case "+i+": return "+i+";break;"; return r+"}"}
jjs> Function(makeSwitch(1,0x7ff,5))()
java.lang.ClassCastException: jdk.nashorn.internal.runtime.Undefined cannot be cast to jdk.nashorn.internal.runtime.Scope
at jdk.nashorn.internal.scripts.Script$\^function\_$2.$split(<function>:2)
at jdk.nashorn.internal.scripts.Script$\^function\_._L1(<function>:1)
at jdk.nashorn.internal.scripts.Script$\^shell\_.runScript(<shell>:1)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:518)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:202)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:366)
at jdk.nashorn.internal.runtime.Context.eval(Context.java:412)
at jdk.nashorn.tools.Shell.readEvalPrint(Shell.java:444)
at jdk.nashorn.tools.Shell.run(Shell.java:168)
at jdk.nashorn.tools.Shell.main(Shell.java:143)
at jdk.nashorn.tools.Shell.main(Shell.java:122)
jjs> function makeSwitch(from,to,v){var r="switch("+v+"){"; for (var i=from;i<to;++i)r+="case "+i+": return "+i+";break;"; return r+"}"}
jjs> Function(makeSwitch(1,0x7ff,5))()
java.lang.ClassCastException: jdk.nashorn.internal.runtime.Undefined cannot be cast to jdk.nashorn.internal.runtime.Scope
at jdk.nashorn.internal.scripts.Script$\^function\_$2.$split(<function>:2)
at jdk.nashorn.internal.scripts.Script$\^function\_._L1(<function>:1)
at jdk.nashorn.internal.scripts.Script$\^shell\_.runScript(<shell>:1)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:518)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:202)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:366)
at jdk.nashorn.internal.runtime.Context.eval(Context.java:412)
at jdk.nashorn.tools.Shell.readEvalPrint(Shell.java:444)
at jdk.nashorn.tools.Shell.run(Shell.java:168)
at jdk.nashorn.tools.Shell.main(Shell.java:143)
at jdk.nashorn.tools.Shell.main(Shell.java:122)