I have a ColdFusion parent component with a function that looks something like this:
public numeric function myFunction(var1, var2, var3, var4, var5){
... function code ...
}
Then I have a child component that extends this component and has the following function:
public numeric function myFunction(var1, var2, var3){
super.myFunction(var1, var2, var3, variables.var4, variables.var5);
}
Where variables.var4
and variables.var5
are properties of the child.
The problem is that var1, var2, and var3 are optional. If any of them are not passed in, I get an error on the super.myFunction
call:
Variable VAR2 is undefined
How can I invoke the parent method with whichever parameters were actually passed in + the 2 child properties? (Without spaghetti conditional coding)