mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
fix a bug in console.log with non-string args (#24546)
This commit is contained in:
+2
-1
@@ -181,8 +181,9 @@ export function formatWithStyles(
|
||||
inputArgs === undefined ||
|
||||
inputArgs === null ||
|
||||
inputArgs.length === 0 ||
|
||||
typeof inputArgs[0] !== 'string' ||
|
||||
// Matches any of %c but not %%c
|
||||
(typeof inputArgs[0] === 'string' && inputArgs[0].match(/([^%]|^)(%c)/g)) ||
|
||||
inputArgs[0].match(/([^%]|^)(%c)/g) ||
|
||||
style === undefined
|
||||
) {
|
||||
return inputArgs;
|
||||
|
||||
+2
-2
@@ -180,9 +180,9 @@ export function installHook(target: any): DevToolsHook | null {
|
||||
inputArgs === undefined ||
|
||||
inputArgs === null ||
|
||||
inputArgs.length === 0 ||
|
||||
typeof inputArgs[0] !== 'string' ||
|
||||
// Matches any of %c but not %%c
|
||||
(typeof inputArgs[0] === 'string' &&
|
||||
inputArgs[0].match(/([^%]|^)(%c)/g)) ||
|
||||
inputArgs[0].match(/([^%]|^)(%c)/g) ||
|
||||
style === undefined
|
||||
) {
|
||||
return inputArgs;
|
||||
|
||||
Reference in New Issue
Block a user