Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Bradley Wood / Bradley Wood (Bradley Wood)
Created: 10/29/2014
Components: Language
Versions: 11.0
Failure Type: Non Functioning
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Major / All users will encounter
Locale/System: English / Platforms All
Vote Count: 4
The following code sample works as expected on Railo, but throws an error on Adobe ColdFusion ("The append method was not found")
<cfscript>
writeDump( structNew().append( { foo:'bar' } ).append( { bum:'baz' } ) );
writeDump( arrayNew( 1 ).append( 'a' ).append( 'b' ) );
</cfscript>
The issue is that the member functions do not return the struct/array, but a boolean. While compatible with the old structAppend() and arrayAppend() functions, this makes them virtually useless in any scenario where I'm trying to clean up extra cruft code and append some things together on the fly as a self-contained expression that can be passed directly into another function, etc.
0
<cfscript>
leftProps = { borderLeft = 'THIN', leftBorderColor = 'blue' };
topProps = { borderTop = 'THIN', topBorderColor = 'blue' };
newStyle( {}.append( topProps ).append( leftProps ) )
</cfscript>
(See bug 3844972 as well)
Again, the code above works great on Railo 4.2 and is what pretty much any scripting dev would expect from another language.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3844976
External Customer Info:
External Company:
External Customer Name: bradwood.com
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: