FIO-9942: use 'this' instead of 'Evaluator' for inheritance support#240
FIO-9942: use 'this' instead of 'Evaluator' for inheritance support#240brendanbond merged 1 commit intomasterfrom
Conversation
brendanbond
left a comment
There was a problem hiding this comment.
These are classes with almost exclusively static methods, I'm not sure this change will function like we think. Can you confirm?
|
The registerEvaluator method allows external modules to extend the Evaluator class: However, using In our case, when we register a protected evaluator using The registerEvaluator method exists in Evaluator. So when we use the line This causes problems when we later try to access the registerEvaluator method or the registered evaluator from Evaluator on formio/js, such as in this line: At that point, registerEvaluator is undefined, because it's not present on the actual Evaluator class. My fix: |
Link to Jira Ticket
https://formio.atlassian.net/browse/FIO-9942
Description
Added a static registerEvaluator method to work properly with extended evaluator classes by using this instead of referencing the base Evaluator class directly.
This ensures that any subclass extending the Evaluator can successfully register additional methods or properties using registerEvaluator.
Dependencies
How has this PR been tested?
manually during the process of connecting @formio/protected-eval to 5.x renderer.
Checklist: