use of lucee.transformer.bytecode.expression.var.VariableRef in project Lucee by lucee.
the class TryCatchFinally method addCatch.
/**
* @param type
* @param name
* @param b
* @param line
* @throws TransformerException
*/
public void addCatch(Expression type, Expression name, Body b, Position line) throws TransformerException {
// type
if (type == null || type instanceof ExprString)
;
else if (type instanceof Variable) {
type = VariableString.toExprString(type);
} else
throw new TransformerException("type from catch statement is invalid", type.getStart());
// name
if (name instanceof LitString) {
Variable v = getFactory().createVariable(Scope.SCOPE_UNDEFINED, name.getStart(), name.getEnd());
v.addMember(getFactory().createDataMember(getFactory().toExprString(name)));
name = new VariableRef(v, true);
} else if (name instanceof Variable)
name = new VariableRef((Variable) name, true);
else
throw new TransformerException("name from catch statement is invalid", name.getStart());
addCatch((ExprString) type, (VariableRef) name, b, line);
}
Aggregations