/
githubmirror
/
redux
Обзор
Документация
Войти
/
githubmirror
/
redux
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v3.7.2
src/utils/warning.js
21 строка
635 B
Steve Mao
Better comment for dummy try...catch block (#1649)
20 апр 2016, 19:13
20 апр 2016, 19:13
2e394e2
Код
Авторство
О чём код?
/** * Prints a warning in the console if it exists. * * @param {String} message The warning message. * @returns {void} */ export default function warning(message) { /* eslint-disable no-console */ if (typeof console !== 'undefined' && typeof console.error === 'function') { console.error(message) } /* eslint-enable no-console */ try { // This error was thrown as a convenience so that if you enable // "break on all exceptions" in your console, // it would pause the execution at this line. throw new Error(message) /* eslint-disable no-empty */ } catch (e) { } /* eslint-enable no-empty */ }