core.global.registerScope(global);
context.putThreadLocal("threadscope", global);
    public void updatePrototypes() throws IOException {        context = Context.enter();        context.setCompileFunctionsWithDynamicScope(true);        context.setApplicationClassLoader(app.getClassLoader());        context.setWrapFactory(core.wrapper);        // if visual debugger is on let it know we're entering a context        if (core.debugger != null) {            core.initDebugger(context);        }        if ("true".equals(app.getProperty("rhino.trace"))) {            context.setDebugger(new Tracer(getResponse()), null);        }        // Set default optimization level according to whether debugger is on        int optLevel = core.debugger == null ? 0 : -1;        try {            optLevel = Integer.parseInt(app.getProperty("rhino.optlevel"));        } catch (Exception ignore) {        }        context.setOptimizationLevel(optLevel);        // register the per-thread scope with the dynamic scope        core.global.registerScope(global);        context.putThreadLocal("reval", reval);        context.putThreadLocal("engine", this);        // update prototypes        core.updatePrototypes();    }