Then I get a different error. Is this a bug? Because the argument type for validationData is “string” in all of the interface definitions. Yet, UDFValidator calls arguments.validationData like it is a closure. So I’m confused as to how this could ever work.
I’m on Railo 4.1, I assume the closure should work there too. But it does not. I don’t see how it could, considering the argument validationData is typed as “string” in the IValidationManager and IValidator interfaces.
Since I am passing in a closure or function as the value for validationData, it throws an exception.
Sorry, I confused your thread for someone else’s who said they were on 9.02. Have you changed the “string” to “any” to see if it works. The validation could have been added later in error. I haven’t had a chance to look at that code myself though. I was hoping Luis would chime in.
I started down the path of changing “string” to “any” in my validator, but this causes another error in that my validator no longer matches the interface. So, then I changed it to “any” in both the iValidationManager and iValidator interfaces, and subsequently broke all of the other core validators, because they still use “string” and no longer match the interface definition.
I thought about changing them all to “any” but at that point it seemed like kind of a rabbit hole and not knowing enough about why Luis decided on using “string” instead of “any” to begin with I was worried about other unintended consequences.