UDF in a CFC: Version 8 versus 9

Another weird little difference I discovered yesterday between version 8 and version 9 of ColdFusion.

Scenario, you have a component and declare a valid function in that CFC that steps on the name of a built-in ColdFusion function. In my case, it was “log,” which CF uses as a logarithm function. Code:

<cfcomponent>
<cffunction name="log">
<cfargument name="anything">
</cffunction>
</cfcomponent>

In version 8, this will throw an exception error. In version 9, it works fine.
This seems like a bug as you should, in theory, be able to name your component functions whatever you’d like as they’re always going to be referenced with the object and never directly like the built-in function will be. Obviously Adobe also thought it was a bug and has fixed this issue with version 9.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.