util: allow deprecate on classes
Checklist
-
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
- util
Description of change
Classes objects cannot be called without new. util.deprecate executes 'fn.apply'. Classes cannot be deprecated with util.deprecate.
This uses 'new.target' to detect (when process is defined) calls to constructor to allow deprecate on class.