Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
37
wp/wp-includes/js/dist/warning.js
vendored
37
wp/wp-includes/js/dist/warning.js
vendored
@@ -43,10 +43,10 @@ const logged = new Set();
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
function isDev() {
|
||||
return typeof process !== 'undefined' && process.env && "production" !== 'production';
|
||||
return true && true === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows a warning with `message` if environment is not `production`.
|
||||
*
|
||||
@@ -64,28 +64,27 @@ function isDev() {
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
|
||||
|
||||
function warning(message) {
|
||||
if (!isDev()) {
|
||||
return;
|
||||
} // Skip if already logged.
|
||||
|
||||
|
||||
if (logged.has(message)) {
|
||||
return;
|
||||
} // eslint-disable-next-line no-console
|
||||
|
||||
|
||||
console.warn(message); // Throwing an error and catching it immediately to improve debugging
|
||||
// A consumer can use 'pause on caught exceptions'
|
||||
// https://github.com/facebook/react/issues/4216
|
||||
|
||||
try {
|
||||
throw Error(message);
|
||||
} catch (x) {// Do nothing.
|
||||
}
|
||||
|
||||
// Skip if already logged.
|
||||
if (logged.has(message)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(message);
|
||||
|
||||
// Throwing an error and catching it immediately to improve debugging
|
||||
// A consumer can use 'pause on caught exceptions'
|
||||
// https://github.com/facebook/react/issues/4216
|
||||
try {
|
||||
throw Error(message);
|
||||
} catch (x) {
|
||||
// Do nothing.
|
||||
}
|
||||
logged.add(message);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user