core-decorators
core-decorators copied to clipboard
suppressWarnings decorator function cannot suppress deprecated decorator function call console.warn output
import { suppressWarnings } from 'core-decorators';
class Person {
@deprecated
facepalm() {}
@suppressWarnings
facepalmWithoutWarning() {
console.warn("it is not output"); // not output
this.facepalm();
}
}
let person = new Person();
person.facepalmWithoutWarning();
// no warning is logged
The above code actually runs, it will still be able to call console.warn and output the warning, but facepalmWithoutWarning function call console.warn is not output.