mirror of
https://github.com/facebook/react.git
synced 2026-02-21 19:31:52 +00:00
[Perf Tracks] Handle function names that aren't strings (#35659)
This commit is contained in:
committed by
GitHub
parent
230772f99d
commit
da64117876
@@ -253,10 +253,15 @@ export function addValueToProperties(
|
||||
return;
|
||||
}
|
||||
case 'function':
|
||||
if (value.name === '') {
|
||||
const functionName = value.name;
|
||||
if (
|
||||
functionName === '' ||
|
||||
// e.g. proxied functions or classes with a static property "name" that's not a string
|
||||
typeof functionName !== 'string'
|
||||
) {
|
||||
desc = '() => {}';
|
||||
} else {
|
||||
desc = value.name + '() {}';
|
||||
desc = functionName + '() {}';
|
||||
}
|
||||
break;
|
||||
case 'string':
|
||||
|
||||
Reference in New Issue
Block a user