mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Delete suppressWarning in OSS (#30312)
I'm pretty sure this is completely unnecessary even in www and RN because it's only useful if you use the mock scheduler which typically only we do in our own tests. But all our tests pass so unless www/RN does something with it, I don't think this is used. Also remove unnecessary `__DEV__` check. If it gets pulled in prod, we'd want to know about it.
This commit is contained in:
@@ -8,11 +8,8 @@
|
||||
import ReactSharedInternals from 'shared/ReactSharedInternals';
|
||||
import {enableOwnerStacks} from 'shared/ReactFeatureFlags';
|
||||
|
||||
let suppressWarning = false;
|
||||
export function setSuppressWarning(newSuppressWarning) {
|
||||
if (__DEV__) {
|
||||
suppressWarning = newSuppressWarning;
|
||||
}
|
||||
// TODO: Noop. Delete.
|
||||
}
|
||||
|
||||
// In DEV, calls to console.warn and console.error get replaced
|
||||
@@ -22,19 +19,11 @@ export function setSuppressWarning(newSuppressWarning) {
|
||||
// they are left as they are instead.
|
||||
|
||||
export function warn(format, ...args) {
|
||||
if (__DEV__) {
|
||||
if (!suppressWarning) {
|
||||
printWarning('warn', format, args, new Error('react-stack-top-frame'));
|
||||
}
|
||||
}
|
||||
printWarning('warn', format, args, new Error('react-stack-top-frame'));
|
||||
}
|
||||
|
||||
export function error(format, ...args) {
|
||||
if (__DEV__) {
|
||||
if (!suppressWarning) {
|
||||
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
||||
}
|
||||
}
|
||||
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-internal/no-production-logging
|
||||
|
||||
Reference in New Issue
Block a user