thread = Thread.currentThread();
global = new GlobalObject(core, app, true);
context = core.contextFactory.enterContext();
if (core.hasTracer) {
context.setDebugger(new Tracer(getResponse()), null);
} else if (useProfiler()) {
context.setDebugger(new Profiler(), null);
}
// register the engine with the current thread