mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Gate inlined consoleWithStackDev transpilation (#30317)
This code is getting deleted in #30313 anyway but it should've been gated all along. This code exists to basically manually transpile console.error to consoleWithStackDev because the transpiler doesn't work on `.apply` or `.bind` or the dynamic look up. We only apply the transform in DEV so we should've only done this in DEV. Otherwise these logs get silenced in prod.
This commit is contained in:
committed by
GitHub
parent
a5cc797b88
commit
a09950ed41
@@ -65,9 +65,9 @@ export function printToConsole(
|
||||
);
|
||||
}
|
||||
|
||||
if (methodName === 'error') {
|
||||
if (methodName === 'error' && __DEV__) {
|
||||
error.apply(console, newArgs);
|
||||
} else if (methodName === 'warn') {
|
||||
} else if (methodName === 'warn' && __DEV__) {
|
||||
warn.apply(console, newArgs);
|
||||
} else {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
|
||||
@@ -46,9 +46,9 @@ export function printToConsole(
|
||||
newArgs.splice(offset, 0, badgeFormat, pad + badgeName + pad);
|
||||
}
|
||||
|
||||
if (methodName === 'error') {
|
||||
if (methodName === 'error' && __DEV__) {
|
||||
error.apply(console, newArgs);
|
||||
} else if (methodName === 'warn') {
|
||||
} else if (methodName === 'warn' && __DEV__) {
|
||||
warn.apply(console, newArgs);
|
||||
} else {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
|
||||
@@ -66,9 +66,9 @@ export function printToConsole(
|
||||
);
|
||||
}
|
||||
|
||||
if (methodName === 'error') {
|
||||
if (methodName === 'error' && __DEV__) {
|
||||
error.apply(console, newArgs);
|
||||
} else if (methodName === 'warn') {
|
||||
} else if (methodName === 'warn' && __DEV__) {
|
||||
warn.apply(console, newArgs);
|
||||
} else {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
|
||||
Reference in New Issue
Block a user