Ryan Albrecht
01/25/2023, 7:35 PM//code 1
param arguments.value = invoke( this, "get" & arguments.key );
//code 2
if(!isDefined('arguments.value')){
arguments.value = invoke( this, "get" & arguments.key );
}
bdw429s
01/25/2023, 7:38 PMvariables.arguments.value
yeah, it seems the same.Ryan Albrecht
01/25/2023, 7:40 PMRyan Albrecht
01/25/2023, 7:40 PMRyan Albrecht
01/25/2023, 7:40 PMRyan Albrecht
01/25/2023, 7:46 PMRyan Albrecht
01/25/2023, 8:18 PMAdam Cameron
structKeyExists
might be a bit more C21st than using isDefined
. isDefined
has not really been recommended in this sorta situation since CFMX6.
Or - better, now that I look at the pull req and the surrounding code - to keep it analogous to the code following it, just isNull
?
if (isNull(arguments.value) {
arguments.value = invoke( this, "get" & arguments.key );
}
Also the comment you have in the code doesn't really belong there, because yer referring to code that doesn't exist any more (as you have removed it in the very pull req you are making), so it's lost its context. It'd be a good comment on the pull req itself, that said.
I would probs wanna write some tests for this sort of low-level change too, given it's in BaseEntity
. I dunno how strong this project is on testing though.Adam Cameron
Ryan Albrecht
01/25/2023, 8:43 PMAdam Cameron
Adam Cameron
"it is considered null if no value is given, and the property is not already set"
or something?Ryan Albrecht
01/25/2023, 8:53 PMRyan Albrecht
01/25/2023, 8:53 PMAdam Cameron
Adam Cameron