Sunday, May 20, 2018

CF-4202538 - null breaks accessors if default defined

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

ColdFusion member functions for XML object management

Prior to ColdFusion 2018, ColdFusion supported the following XML member functions : .elemNew() (equivalent of XmlElemNew ) .childPos(...