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:
Sebastian Markbåge
2024-07-11 13:05:26 -04:00
committed by GitHub
parent a5cc797b88
commit a09950ed41
3 changed files with 6 additions and 6 deletions

View File

@@ -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]

View File

@@ -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]

View File

@@ -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]