Title:
ColdFusion does not throw an exception when closure and UDF have the same name
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/NotABug
Reporter/Name(from Bugbase): / ext-user (Suchika Singh)
Created: 08/31/2016
Components: Language, Functions
Versions: 2016,11.0,10.0,2018
Failure Type:
Found In Build/Fixed In Build: latest build /
Priority/Frequency: Normal / Some users will encounter
Locale/System: English / Linux All,Mac 10 All,Solaris All,Win XP All
Vote Count: 0
Problem:
ColdFusion does not throw an exception when closure and UDF have the same name
Method:
Use the following Code:
{code:java}
<cfscript>
function test(a,b)
{
return a+b;
}
</cfscript>
<cfscript>
test=function(a,b)
{
return a-b;
};
</cfscript>
<cfoutput>#test(1,2)#</cfoutput>
{code}
Result:
-1
Expected:
Should throw exception saying routines cannot be declared twice.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4185694
Reason: BugVerified
External Customer Info:
External Company:
External Customer Name:
External Customer Email:
Attachments:
Comments: