Subj : Re: Rhino 1.6R2 release candidate available To : netscape.public.mozilla.jseng From : Olinda Spider Date : Sun Aug 28 2005 01:07 am And finally, while I was browsing the source code, I noticed this obviously wrong sequence. The script object is returned from cx.compileString, then the returned script object is referenced to set it's idata.evalScriptFlag. After the script.idata.evalScriptFlag is set, *then* the script object is checked to see if it is null. Here is the patch of what I believe should be the proper sequence: --- rhino1_6R2pre-org/src/org/mozilla/javascript/ScriptRuntime.java +++ rhino1_6R2pre-new/src/org/mozilla/javascript/ScriptRuntime.java @@ -2195,8 +2195,6 @@ // mode. Script script = cx.compileString((String)x, new Interpreter(), reporter, sourceName, 1, null); - ((InterpretedFunction)script).idata.evalScriptFlag = true; - // if the compile fails, an error has been reported by the // compiler, but we need to stop execution to avoid // infinite looping on while(true) { eval('foo bar') } - // so we throw an EvaluatorException. if (script == null) { String message = ScriptRuntime.getMessage0("msg.syntax"); throw new EvaluatorException(message, filename, lineNumber, null, 0); } + ((InterpretedFunction)script).idata.evalScriptFlag = true; Callable c = (Callable)script; return c.call(cx, scope, (Scriptable)thisArg, ScriptRuntime.emptyArgs); .