use of lucee.runtime.type.scope.LocalNotSupportedScope in project Lucee by lucee.
the class Evaluate method call.
public static Object call(PageContext pc, Object[] objs, boolean preciseMath) throws PageException {
// define a ohter enviroment for the function
if (objs.length > 1 && objs[objs.length - 1] instanceof Scope) {
// Variables Scope
Variables var = null;
Local lcl = null, cLcl = null;
Argument arg = null, cArg = null;
if (objs[objs.length - 1] instanceof Variables) {
var = (Variables) objs[objs.length - 1];
} else if (objs[objs.length - 1] instanceof CallerImpl) {
CallerImpl ci = ((CallerImpl) objs[objs.length - 1]);
var = ci.getVariablesScope();
lcl = ci.getLocalScope();
arg = ci.getArgumentsScope();
}
if (var != null) {
Variables cVar = pc.variablesScope();
pc.setVariablesScope(var);
if (lcl != null && !(lcl instanceof LocalNotSupportedScope)) {
cLcl = pc.localScope();
cArg = pc.argumentsScope();
pc.setFunctionScopes(lcl, arg);
}
try {
return _call(pc, objs, objs.length - 1, preciseMath);
} finally {
pc.setVariablesScope(cVar);
if (cLcl != null)
pc.setFunctionScopes(cLcl, cArg);
}
} else // Undefined Scope
if (objs[objs.length - 1] instanceof Undefined) {
PageContextImpl pci = (PageContextImpl) pc;
Undefined undefined = (Undefined) objs[objs.length - 1];
boolean check = undefined.getCheckArguments();
Variables orgVar = pc.variablesScope();
Argument orgArgs = pc.argumentsScope();
Local orgLocal = pc.localScope();
pci.setVariablesScope(undefined.variablesScope());
if (check)
pci.setFunctionScopes(undefined.localScope(), undefined.argumentsScope());
try {
return _call(pc, objs, objs.length - 1, preciseMath);
} finally {
pc.setVariablesScope(orgVar);
if (check)
pci.setFunctionScopes(orgLocal, orgArgs);
}
}
}
return _call(pc, objs, objs.length, preciseMath);
}
use of lucee.runtime.type.scope.LocalNotSupportedScope in project Lucee by lucee.
the class CFMLFactoryImpl method getInfo.
public Array getInfo() {
Array info = new ArrayImpl();
// synchronized (runningPcs) {
// int len=runningPcs.size();
Iterator<PageContextImpl> it = runningPcs.values().iterator();
PageContextImpl pc;
Struct data, sctThread, scopes;
Thread thread;
Entry<Integer, PageContextImpl> e;
ConfigWebImpl cw;
while (it.hasNext()) {
pc = it.next();
cw = (ConfigWebImpl) pc.getConfig();
data = new StructImpl();
sctThread = new StructImpl();
scopes = new StructImpl();
data.setEL("thread", sctThread);
data.setEL("scopes", scopes);
if (pc.isGatewayContext())
continue;
thread = pc.getThread();
if (thread == Thread.currentThread())
continue;
thread = pc.getThread();
if (thread == Thread.currentThread())
continue;
data.setEL("startTime", new DateTimeImpl(pc.getStartTime(), false));
data.setEL("endTime", new DateTimeImpl(pc.getStartTime() + pc.getRequestTimeout(), false));
data.setEL(KeyConstants._timeout, new Double(pc.getRequestTimeout()));
// thread
sctThread.setEL(KeyConstants._name, thread.getName());
sctThread.setEL("priority", Caster.toDouble(thread.getPriority()));
data.setEL("TagContext", PageExceptionImpl.getTagContext(pc.getConfig(), thread.getStackTrace()));
data.setEL("urlToken", pc.getURLToken());
try {
if (pc.getConfig().debug())
data.setEL("debugger", pc.getDebugger().getDebuggingData(pc));
} catch (PageException e2) {
}
try {
data.setEL(KeyConstants._id, Hash.call(pc, pc.getId() + ":" + pc.getStartTime()));
} catch (PageException e1) {
}
data.setEL(KeyConstants._hash, cw.getHash());
data.setEL("contextId", cw.getIdentification().getId());
data.setEL(KeyConstants._label, cw.getLabel());
data.setEL("requestId", pc.getId());
// Scopes
scopes.setEL(KeyConstants._name, pc.getApplicationContext().getName());
try {
scopes.setEL(KeyConstants._application, pc.applicationScope());
} catch (PageException pe) {
}
try {
scopes.setEL(KeyConstants._session, pc.sessionScope());
} catch (PageException pe) {
}
try {
scopes.setEL(KeyConstants._client, pc.clientScope());
} catch (PageException pe) {
}
scopes.setEL(KeyConstants._cookie, pc.cookieScope());
scopes.setEL(KeyConstants._variables, pc.variablesScope());
if (!(pc.localScope() instanceof LocalNotSupportedScope)) {
scopes.setEL(KeyConstants._local, pc.localScope());
scopes.setEL(KeyConstants._arguments, pc.argumentsScope());
}
scopes.setEL(KeyConstants._cgi, pc.cgiScope());
scopes.setEL(KeyConstants._form, pc.formScope());
scopes.setEL(KeyConstants._url, pc.urlScope());
scopes.setEL(KeyConstants._request, pc.requestScope());
info.appendEL(data);
}
return info;
// }
}
Aggregations