mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
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:
parent
e4944b8bfa
commit
c4f18a9b3a
2 changed files with 14 additions and 13 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue