If you don't want CFBuilder to nag you about the syntax, you can change to this:
local.myReport = seoUtility.init();
local.func = local.myReport[form.action];
local.myReport.func = local.func;
local.report = local.myReport.func(form.user);
This sets local.func
to the instance of seoUtility
as a reference to the actual function you want to call, preserving its relationship to the parent object. This way the offending []()
syntax isn't needed.
However, this only works if seoUtility.init()
is returning a fresh instance every time, as opposed to a singleton shared by the application, in which case there would be a race condition on all calls to local.myReport.func()
.