Status/Resolution/Reason: Needs Review//HaveNewInfo
Reporter/Name(from Bugbase): Aaron Neff / ()
Created: 05/20/2018
Components: Language, Null Support, Wishlist
Versions: 2018
Failure Type: Data Corruption
Found In Build/Fixed In Build: 2018.0.01.308605 (PreRelease) /
Priority/Frequency: Normal / Some users will encounter
Locale/System: / Platforms All
Vote Count: 0
Issue: null breaks accessors if default defined
Steps to Reproduce:
1) Enable NULL support
2) Create index.cfm having:
-----------
<cfscript>
o = new MyCFC()
writeDump(o.f())
</cfscript>
-----------
3) Create MyCFC.cfc having:
-----------
component accessors=true {
property name="myProperty"
function f()
{ setMyProperty("bar");
setMyProperty(null)
return getMyProperty() }
}
-----------
4) Run index.cfm
Actual and Expected Result: bar
5) Run index.cfm after changing MyCFC.cfc to:
-----------
component accessors=true {
property name="myProperty"
function f()
{ setMyProperty("bar") setMyProperty(null) return getMyProperty() }
}
-----------
Actual and Expected Result: [null]
6) Run index.cfm after changing MyCFC.cfc to:
-----------
component accessors=true {
property name="myProperty" default="foo"
function f() \{ setMyProperty("bar") setMyProperty(null) return getMyProperty() }
}
-----------
Actual Result: foo
Expected Result: [null]
Related post: [http://blog.cfaether.com/2018/05/null-breaks-accessors-if-default-defined.html]
Attachments:
Comments: