Title:
Using inline structs in as named arguments inside a block in cfscript causes CF not to execute code.
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Peter Boughton / Peter Boughton (Peter Boughton)
Created: 07/15/2013
Components: Core Runtime
Versions: 10.0
Failure Type: Non Functioning
Found In Build/Fixed In Build: Final / CF10 Update16
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Platforms All
Vote Count: 0
Problem Description:
As per title - in certain situations lines of code do not execute - the parser appears to get confused by inline structs inside function calls - but only if using named arguments and inside a block (if/for/try/etc).
This is very similar issue to https://bugbase.adobe.com/index.cfm?event=bug&id=3482734 - however, whilst that issue was "fixed" in CF10 update 11, the code below still errors on 10,0,11,285437
Steps to reproduce:
<cftry>
<li>Example 1 - named argument, inline struct referencing variable, inside if block.
<cfscript>
if ( true )
{
IgnoredVar = 1;
writeOutput(StructKeyExists(Variables,'IgnoredVar') );
doStuff
( Type = 'json'
, Data = { success:false , error:IgnoredVar }
);
writeOutput(StructKeyExists(Variables,'IgnoredVar') );
StructDelete(Variables,'IgnoredVar');
}
</cfscript>
<cfcatch>
<cfoutput><b style="color:red">Failed</b>: #cfcatch.message#</cfoutput>
</cfcatch>
</cftry>
<cffunction name="doStuff" output=1 >
<cfargument name="type" />
<cfargument name="data" default=#{undefined:1}# />
<b style="color:green">function called</b> #StructKeyList(Arguments)# #StructKeyList(Arguments.Data)#
</cffunction>
See attached code for further examples...
Expected result:
No error.
Any Workarounds:
1. Create struct as variable before function call.
2. Use Railo, which doesn't have any issues.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3594992
External Customer Info:
External Company:
External Customer Name: boughtonp
External Customer Email:
External Test Config: ColdFusion 10,0,11,285437
Attachments:
- July 15, 2013 00:00:00: 1_cf_ignored_code.cfm
Comments: