util: use getOptionValue('--no-deprecation') in deprecated() · nodejs/node@3273143

Commit 3273143

haramjtargos

authored and

committed

util: use getOptionValue('--no-deprecation') in deprecated()

PR-URL: #59760 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

File tree

1 file changed

lines changed

1 file changed

lines changed

Lines changed: 1 addition & 2 deletions

Original file line numberDiff line numberDiff line change

@@ -182,8 +182,7 @@ function deprecate(fn, msg, code, useEmitSync, modifyPrototype = true) {

182182

);

183183
184184

function deprecated(...args) {

185-

// TODO(joyeecheung): use getOptionValue('--no-deprecation') instead.

186-

if (!process.noDeprecation) {

185+

if (!getOptionValue('--no-deprecation') && !process.noDeprecation) {

187186

emitDeprecationWarning();

188187

}

189188

if (new.target) {

0 commit comments