util: support classes in util.deprecate()
Classes cannot be instantiated without new, but util.deprecate() uses Function.prototype.apply(). This commit uses new.target to detect constructor calls, allowing classes to be deprecated. PR-URL: https://github.com/nodejs/node/pull/7690 Reviewed-By:Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Michaël Zasso <mic.besace@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
parent
e1643ccc
Please register or sign in to comment