Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron ()
Created: 10/11/2017
Components: Language
Versions: 2016,2018
Failure Type: Others
Found In Build/Fixed In Build: 2016 / 2018,0,0,307104
Priority/Frequency: Normal /
Locale/System: / Platforms All
Vote Count: 1
This works:
<cfscript>
suffix = "Something";
"myString#suffix#" = "a string";
writeDump(variables);
</cfscript>
*This* works:
<cfscript>
myFunctionSomething = function (){};
writeDump(variables);
</cfscript>
This should work, but does not:
<cfscript>
suffix = "Something";
"myFunction#suffix#" = function (){};
writeDump(variables);
</cfscript>
Error:
Invalid CFML construct found on line 3 at column 1.
ColdFusion was looking at the following text:
/"
The error occurred in C:/apps/adobe/ColdFusion/2016/express/cfusion/wwwroot/CF2018/src/misc/functionExpressionWithDynamicName.cfm: line 3
1 : <cfscript>
2 : suffix = "Something";
3 : "myFunction#suffix#" = function (){};
4 : writeDump(variables);
5 : </cfscript>
This is a simplified repro case, natch.
NB, this also works:
<cfscript>
suffix = "Something";
variables["myFunction#suffix#"] = function (){};
writeDump(variables);
</cfscript>
But that's beside the point. The version that breaks should also work.
Attachments:
Comments: