Describe the bug
Blockly.Field.prototype.doClassValidation_ calls Blockly.Field.prototype.classValidator which logs a deprecation warning asking to use Blockly.Field.prototype.doClassValidation_ instead. This warning is can be triggered by calling public methods that use doClassValidation like setValue.
To Reproduce
var field = new Blockly.Field();
field.setValue('value');
Expected behavior
Stack Traces
deprecation.js:33 Field.prototype.classValidator was deprecated on May 2019 and will be deleted on December 2020.
Use Blockly.Field.prototype.doClassValidation_ instead.
Additional context
Causes a lot of console warnings in field tests. #4194
Deprecation warning introduced as part of #4049.
I think in this case it might be good to keep calling it until it's actually removed. The reason it gets called is for backwards compatibility with old-style custom field definitions. Those warnings sound really annoying though...
Probably a silly idea: but maybe an extra parameter could be added to the classValidator method that means it skips the warning?
I was trying to come up with a way to wrap the function so that tests could skip the warning but outside devs would get it. But I don't think that's possible in this case :/ An extra param seems like the next best thing.
I think in this case it might be good to keep calling it until it's actually removed. The reason it gets called is for backwards compatibility with old-style custom field definitions. Those warnings sound really annoying though...
Probably a silly idea: but maybe an extra parameter could be added to the classValidator method that means it skips the warning?
I was trying to come up with a way to wrap the function so that tests could skip the warning but outside devs would get it. But I don't think that's possible in this case :/ An extra param seems like the next best thing.
Maybe a way to turn on/off deprecation warning logs explicitly could help and also make sure that we add a TODO with issue where we turn off/on deprecation warning. The issue could track any additional work that will need to be done before we can fully remove the method (and explain why we are calling the deprecated method).
This call was removed in #4489
Most helpful comment
Maybe a way to turn on/off deprecation warning logs explicitly could help and also make sure that we add a TODO with issue where we turn off/on deprecation warning. The issue could track any additional work that will need to be done before we can fully remove the method (and explain why we are calling the deprecated method).