Status/Resolution/Reason: Closed/Withdrawn/Duplicate
Reporter/Name(from Bugbase): Henry Ho / Henry Ho (Henry Ho)
Created: 04/08/2016
Components: Language, CF Component
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Major / All users will encounter
Locale/System: English / Win All
Vote Count: 1
Duplicate ID: CF-4076193
Problem Description:
with accessor=true, property default should be set and ready to go in Variables scope, but it is only true if the object is instantiated with the 'new' operator, and fails with CreateObject('component')
Steps to Reproduce:
// foo.cfc
component accessors="true" {
property name="bar" default="1";
function isBarDefined() {
return structKeyExists(variables, 'bar');
}
}
// testFoo.cfm
<cfscript>
f1 = new Foo();
writeoutput(f1.isBarDefined());
f2 = createObject("component", 'Foo');
writeoutput(f2.isBarDefined());</cfscript>
Actual Result:
YES NO
Expected Result:
YES YES
Any Workarounds:
manually call getter first, then the var will be set into variables scope.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4137849
External Customer Info:
External Company:
External Customer Name: Henry Ho
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: