private Object js_eval(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { if (thisObj.getParentScope() == null) { // We allow indirect calls to eval as long as the script will execute in // the global scope. return ScriptRuntime.evalSpecial(cx, scope, thisObj, args, "eval code", 1); } String m = ScriptRuntime.getMessage1("msg.cant.call.indirect", "eval"); throw NativeGlobal.constructError(cx, "EvalError", m, scope); }