return (T) controllerDef.createAction(descriptor.getName(), attributes);
} finally {
context.popCallingDescriptor();
}
case EVENT:
return (T) new EventImpl((DefDescriptor<EventDef>) descriptor, attributes);
default:
throw new AuraRuntimeException(String.format("Instances of %s cannot be created.", defType));
}
}