Title:
Bug 79244:ColdFusion seems to have some issues with the order of evaluation for certain expressions
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Nathan Mische / Nathan Mische (Nathan Mische)
Created: 08/03/2009
Components: General Server
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 9,0,0,241018 / 245649
Priority/Frequency: Normal / Unknown
Locale/System: English / Win All
Vote Count: 1
Problem:
ColdFusion seems to have some issues with the order of evaluation for certain expressions. Here is one example:// struct literal example// results in error: Complex object types cannot be converted to simple values.s = "a,b,c";s = { first = listFirst(s), rest = listRest(s) };It appears that ColdFusion evaluates the above as if it were written as:s = "a,b,c";s = structNew();s.first = listFirst(s);s.rest = listRest(s);However, the correct evaluation of this example should produce the same results as the following code:s = "a,b,c";temp = structNew();temp.first = listFirst(s);temp.rest = listRest(s);s = temp;Here is another example using multiple assignments:// multiple assignment example// results in error: Variable USER is undefined.users = [];for (i=1; i < 50; i++) { users[i] = user = structNew(); user.userID = i;}It appears ColdFusion evaluates the above as:users = [];for (i=1; i < 50; i++) { users[i] = user; user = structNew(); user.userID = i;}However, the correct evaluation of this example should produce the same results as the following code:users = [];for (i=1; i < 50; i++) { user = structNew(); users[i] = user; user.userID = i;}
Method:
Run the following examples:// struct literal example// results in error: Complex object types cannot be converted to simple values.s = "a,b,c";s = { first = listFirst(s), rest = listRest(s) };// multiple assignment example// results in error: Variable USER is undefined.users = [];for (i=1; i < 50; i++) { users[i] = user = structNew(); user.userID = i;}
Result:
Issues with Order of Expression Evaluation
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3039532
External Customer Info:
External Company:
External Customer Name: Nathan Mische
External Customer Email: 8183044544637AAA99201549
External Test Config: 08/03/2009
Attachments:
Comments: