// In tracing/debugging mode, evaluate all the global variables first
TraceListener tracer = controller.getTraceListener();
if (tracer != null) {
controller.preEvaluateGlobals(context);
tracer.open();
}
context.openStackFrame(stackFrameMap);
boolean mustClose = (result instanceof StreamResult &&