invokeImplicitAccessor should be a CFC setting, not an Application.cfc setting

Description

See equiv CF bug: https://bugbase.adobe.com/index.cfm?event=bug&id=3941602

SSIA, really.

This functionality is specifically related to CFCs, and only makes sense if implemented on a CFC-by CFC basis.

Indeed, the setting shouldn't be necessary at all! This should just work:

~~~~
// General.cfc
component {
property x;

function getX(){
return x;
}

function setX{
variables.x = arguments.x;
}
}
~~~~

~~~~
// general.cfm
o = new General();
o.x = "value"; // calls setX()
writeOutput("Value from o.x: #o.x#<br>"); // calls getX()
~~~~

It shouldn't need a setting for this to work. It should just work!

I was tempted to raise this as a bug because it's just a shoddy approach to the functionality, but I suspect you were just copying Adobe. So it's their fault

Activity

Show:

Adam Cameron 11 July 2021 at 12:31
Edited

I have just fallen foul of this. It’s 2021 now… this has been an incompatibility bug for >4yrs…?

Ryan Guill 26 February 2015 at 01:05

I am for this, especially on a per-cfc basis - my preference would be for a syntax like AS3:
```
function set propertyName (value) {};

function get propertyName () {}
```

I would also like to have an ```onMissingProperty()``` method, that would trigger for both accessor and mutator access.

Adam Cameron 18 February 2015 at 05:17

If there was concern about backwards compat (although I don't see it), perhaps follow C#'s lead (https://msdn.microsoft.com/en-us/library/aa287786%28v=vs.71%29.aspx) for CFML, something like this:

~~~~
property name /* other settings */ {
set(value){
// impl.
},
get(){
// impl.
}
}
~~~~

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Priority

Created 18 February 2015 at 05:09
Updated 11 July 2021 at 16:08