@Override
    public synchronized void run() {
        // For commits
        jsContext = new StoppableContext();
        jsContext.setGeneratingDebug(true);
        jsContext.setGeneratingSource(true);
        synchronized (scriptThreads) {
            scriptThreads.put(scriptInfo.scrUniq, this);
        }
        try {
            jsScope = jsContext.initStandardObjects();
            loadStaticClass(jsScope, JSHaven.class);
            Object jsOut = Context.javaToJS(System.out, jsScope);
            ScriptableObject.putProperty(jsScope, "out", jsOut);
            try {
                // Define classes here
                ScriptableObject.defineClass(jsScope, JSDeprecatedHaven.class);

            } catch (IllegalAccessException e) {
                JSBot.JSError(e);
            } catch (InstantiationException e) {
                JSBot.JSError(e);
            } catch (InvocationTargetException e) {
                JSBot.JSError(e);
            }
            OnStart();
            jsContext.evaluateString(jsScope, scriptInfo.scrContent,
                    scriptInfo.scrName, 1, null);
        } catch (StoppedExecutionException e) {
            // do nothing, script stops.
        } catch (Exception ex) {
            JSBot.JSError(ex);
        } finally {
            OnStop();
            Context.exit();
        }
    }