use of lucee.runtime.type.scope.CallerImpl in project Lucee by lucee.
the class CFTag method release.
@Override
public void release() {
super.release();
hasBody = false;
// filename=null;
// .clear();
attributesScope = new StructImpl();
callerScope = new CallerImpl();
if (thistagScope != null)
thistagScope = null;
if (ctVariablesScope != null)
ctVariablesScope = null;
isEndTag = false;
// cfc=null;
source = null;
}
use of lucee.runtime.type.scope.CallerImpl 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.CallerImpl in project Lucee by lucee.
the class VariableInterpreter method _variable.
public static Object _variable(PageContext pc, String str, Object value, Scope scope) throws PageException {
// define a ohter enviroment for the function
if (scope != null) {
// Variables Scope
Variables var = null;
if (scope instanceof Variables) {
var = (Variables) scope;
} else if (scope instanceof CallerImpl) {
var = ((CallerImpl) scope).getVariablesScope();
}
if (var != null) {
Variables current = pc.variablesScope();
pc.setVariablesScope(var);
try {
if (value != NULL)
return setVariable(pc, str, value);
return getVariable(pc, str);
} finally {
pc.setVariablesScope(current);
}
} else // Undefined Scope
if (scope instanceof Undefined) {
PageContextImpl pci = (PageContextImpl) pc;
Undefined undefined = (Undefined) scope;
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 {
if (value != NULL)
return setVariable(pc, str, value);
return getVariable(pc, str);
} finally {
pc.setVariablesScope(orgVar);
if (check)
pci.setFunctionScopes(orgLocal, orgArgs);
}
}
}
if (value != NULL)
return setVariable(pc, str, value);
return getVariable(pc, str);
}
Aggregations