globalError = (EcmaError) e; } else { type.error = (EcmaError) e;
globalError = type.error;
    private synchronized void updateEvaluator(TypeInfo type, Reader reader,                                              String sourceName, int firstline) {        // System.err.println("UPDATE EVALUATOR: "+prototype+" - "+sourceName);        Scriptable threadScope = global.unregisterScope();        try {            // get the current context            Context cx = Context.getCurrentContext();            Scriptable op = type.objectPrototype;            // do the update, evaluating the file            cx.evaluateReader(op, reader, sourceName, firstline, null);        } catch (Exception e) {            app.logEvent("Error parsing file " + sourceName + ": " + e);            // also write to standard out unless we're logging to it anyway            if (!"console".equalsIgnoreCase(app.getProperty("logDir"))) {                System.err.println("Error parsing file " + sourceName + ": " + e);            }            // mark prototype as broken            if (type.error == null && e instanceof EcmaError) {                if ("global".equals(type.frameworkPrototype.getLowerCaseName())) {                    globalError = (EcmaError) e;                } else {                    type.error = (EcmaError) e;                }                wrappercache.clear();            }            // e.printStackTrace();        } finally {            if (reader != null) {                try {                    reader.close();                } catch (IOException ignore) {                    // shouldn't happen                }            }            if (threadScope != null) {                global.registerScope(threadScope);            }        }    }