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]
Verified in build 2018.0.01.308605 (PreRelease).
Filed as CF-4202538.
 
No comments:
Post a Comment