Title:
for loop var not available in struct literal for arrayAppend if not wrapped in { }
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Henry Ho / Henry Ho (Henry Ho)
Created: 05/23/2014
Components: Language
Versions: 10.0
Failure Type: Incorrect w/Workaround
Found In Build/Fixed In Build: Final / CF11 Update5
Priority/Frequency: Normal / All users will encounter
Locale/System: English / Win All
Vote Count: 2
Steps to Reproduce:
function foo() {
xs = [];
for (var i=1; i<=10; i++)
arrayAppend(xs, {name:i});
}
foo();
Actual Result:
coldfusion.runtime.UndefinedVariableException: Variable I is undefined.
Expected Result:
no exception
Any Workarounds:
function foo() {
xs = [];
for (var i=1; i<=10; i++)
{
arrayAppend(xs, {name:i});
}
}
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3765527
External Customer Info:
External Company:
External Customer Name: henrylearn2rock
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: