padutils: Rename warnWithStack() to warnDeprecated()

This makes it more legitimate for tests to disable the warnings when
testing deprecated functionality.
This commit is contained in:
Richard Hansen 2021-11-30 23:11:21 -05:00
parent e4944b8bfa
commit c4f18a9b3a
2 changed files with 14 additions and 13 deletions

View file

@ -100,9 +100,9 @@ const padutils = {
*
* @param {...*} args - Passed to `console.warn`, with a stack trace appended.
*/
warnWithStack: (...args) => {
warnDeprecated: (...args) => {
const err = new Error();
if (Error.captureStackTrace) Error.captureStackTrace(err, padutils.warnWithStack);
if (Error.captureStackTrace) Error.captureStackTrace(err, padutils.warnDeprecated);
err.name = '';
if (err.stack) args.push(err.stack);
console.warn(...args);