Commit 320f433d authored by vladimir's avatar vladimir Committed by cjihrig
Browse files

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: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarMichaël Zasso <mic.besace@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent e1643ccc
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment