Title:
Bug 82757:Struct literals are not allowed in function argument defaults in cfscript
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/
Reporter/Name(from Bugbase): Sean Corfield / Sean Corfield (Sean Corfield)
Created: 04/27/2010
Components: Language, CFSCRIPT
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Minor / Unknown
Locale/System: English / Platforms All
Vote Count: 0
Problem:
Struct literals are not allowed in function argument defaults in cfscript.
Method:
<cfscript>// the default for arg3 causes a parse error:function test( struct arg1, struct arg2 = structNew(), struct arg3 = { } ) {}test( { } );</cfscript>
Result:
The web site you are accessing has experienced an unexpected error.Please contact the website administrator. The following information is meant for the website developer for debugging purposes.Error Occurred While Processing RequestInvalid CFML construct found on line 2 at column 70.ColdFusion was looking at the following text:{The CFML compiler was processing:A script statement beginning with function on line 2, column 1.A cfscript tag beginning on line 1, column 2. The error occurred in /Applications/ColdFusion9/wwwroot/cf9/structfn.cfm: line 21 : Ôªø<cfscript>2 : function test( struct arg1, struct arg2 = structNew(), struct arg3 = { } ) {3 : }4 : test( { } );Resources:Check the ColdFusion documentation to verify that you are using the correct syntax.Search the Knowledge Base to find a solution to your problem.Browser Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7Remote Address 0:0:0:0:0:0:0:1%0Referrer Date/Time 27-Apr-10 09:07 AMStack Tracecoldfusion.compiler.ParseException: Invalid CFML construct found on line 2 at column 70.at coldfusion.compiler.cfml40.generateParseException(cfml40.java:11961)at coldfusion.compiler.cfml40.jj_consume_token(cfml40.java:11832)at coldfusion.compiler.cfml40.parameterDefinition(cfml40.java:3172)at coldfusion.compiler.cfml40.functionDefinition(cfml40.java:2918)at coldfusion.compiler.cfml40.cfscriptStatement(cfml40.java:1523)at coldfusion.compiler.cfml40.cfscript(cfml40.java:1403)at coldfusion.compiler.cfml40.cfml(cfml40.java:4236)at coldfusion.compiler.cfml40.start(cfml40.java:4662)at coldfusion.compiler.NeoTranslator.parsePage(NeoTranslator.java:667)at coldfusion.compiler.NeoTranslator.parsePage(NeoTranslator.java:648)at coldfusion.compiler.NeoTranslator.parseAndTransform(NeoTranslator.java:401)at coldfusion.compiler.NeoTranslator.translateJava(NeoTranslator.java:343)at coldfusion.compiler.NeoTranslator.translateJava(NeoTranslator.java:144)at coldfusion.runtime.TemplateClassLoader$TemplateCache$1.fetch(TemplateClassLoader.java:418)at coldfusion.util.LruCache.get(LruCache.java:180)at coldfusion.runtime.TemplateClassLoader$TemplateCache.fetchSerial(TemplateClassLoader.java:362)at coldfusion.util.AbstractCache.fetch(AbstractCache.java:58)at coldfusion.util.SoftCache.get_statsOff(SoftCache.java:133)at coldfusion.util.SoftCache.get(SoftCache.java:81)at coldfusion.runtime.TemplateClassLoader.findClass(TemplateClassLoader.java:591)at coldfusion.filter.PathFilter.invoke(PathFilter.java:80)at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53)at coldfusion.CfmServlet.service(CfmServlet.java:200)at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)at jrun.servlet.FilterChain.service(FilterChain.java:101)at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3041373
Deployment Phase: Release Candidate
External Customer Info:
External Company:
External Customer Name: Sean Corfield
External Customer Email: 479B4EDC43F3A88B992016B6
External Test Config: 04/27/2010
Attachments:
Comments: