Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Jon Hartmann / Jon Hartmann (jon.hartmann)
Created: 03/21/2009
Components: Language, CF Component
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Major / Unknown
Locale/System: English / Win All
Vote Count: 0
Problem:
I was seeing how CF9 interacted with CF on Wheels 0.9, and as soon as I tried to open it I received an error. It seems that CF is mistaking a line of code for a component declaration.
Method:
Put the following code into a .cfm page and open it.
<cffunction name="$runFilters" returntype="void" access="public" output="false">
<cfargument name="controller" type="any" required="true">
<cfargument name="actionName" type="string" required="true">
<cfargument name="type" type="string" required="true">
<cfscript>
var loc = {};
if (arguments.type == "before")
loc.filters = arguments.controller.$getBeforeFilters();
else
loc.filters = arguments.controller.$getAfterFilters();
loc.iEnd = ArrayLen(loc.filters);
for (loc.i=1; loc.i LTE loc.iEnd; loc.i=loc.i+1)
{
if ((!Len(loc.filters[loc.i].only) && !Len(loc.filters[loc.i].except)) || (Len(loc.filters[loc.i].only) && ListFindNoCase(loc.filters[loc.i].only, arguments.actionName)) || (Len(loc.filters[loc.i].except) && !ListFindNoCase(loc.filters[loc.i].except, arguments.actionName)))
$invoke(component=arguments.controller, method=loc.filters[loc.i].through);
}
</cfscript>
</cffunction>
Result:
function keyword is missing in FUNCTION declaration.
The CFML compiler was processing:
A script statement beginning with $invoke on line 15, column 33.
A script statement beginning with if on line 14, column 25.
A script statement beginning with { on line 13, column 17.
A script statement beginning with for on line 12, column 17.
A cfscript tag beginning on line 5, column 10.
A cfscript tag beginning on line 5, column 10.
The error occurred in F:\wwwroot\testing\index.cfm: line 15
13 : {
14 : if ((!Len(loc.filters[loc.i].only) && !Len(loc.filters[loc.i].except)) || (Len(loc.filters[loc.i].only) && ListFindNoCase(loc.filters[loc.i].only, arguments.actionName)) || (Len(loc.filters[loc.i].except) && !ListFindNoCase(loc.filters[loc.i].except, arguments.actionName)))
15 : $invoke(component=arguments.controller, method=loc.filters[loc.i].through);
16 : }
17 : </cfscript>
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3037975
External Customer Info:
External Company:
External Customer Name: Jon Hartmann
External Customer Email: 3124041A447C75CA99201549
External Test Config: 03/21/2009
Attachments:
Comments: